FIX: fix saving address widget
This commit is contained in:
@@ -19,7 +19,7 @@ class Widget
|
|||||||
$widget->name = $data['name'];
|
$widget->name = $data['name'];
|
||||||
$widget->description = $data['description'];
|
$widget->description = $data['description'];
|
||||||
$widget->container_class = $data['containerClass'];
|
$widget->container_class = $data['containerClass'];
|
||||||
$widget->container_id = $data['containerId'];
|
$widget->container_id = empty($data['containerId']) ? null : $data['containerId'];
|
||||||
$widget->settings = json_encode(call_user_func([$widgetType->handler, 'save'], $request));
|
$widget->settings = json_encode(call_user_func([$widgetType->handler, 'save'], $request));
|
||||||
|
|
||||||
// save into database
|
// save into database
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
namespace App\Events;
|
namespace App\Events;
|
||||||
|
|
||||||
use App\Models\WidgetArea;
|
use App\Models\Widgets\WidgetArea;
|
||||||
use Illuminate\Queue\SerializesModels;
|
use Illuminate\Queue\SerializesModels;
|
||||||
|
|
||||||
class DeleteWidgetArea extends Event
|
class DeleteWidgetArea extends Event
|
||||||
@@ -20,7 +20,6 @@ class DeleteWidgetArea extends Event
|
|||||||
*/
|
*/
|
||||||
public function __construct(WidgetArea $widgetArea)
|
public function __construct(WidgetArea $widgetArea)
|
||||||
{
|
{
|
||||||
//
|
|
||||||
$this->widgetArea = $widgetArea;
|
$this->widgetArea = $widgetArea;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,15 +24,15 @@ class Presenter implements WidgetRenderer
|
|||||||
if (!$form)
|
if (!$form)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
$formData = json_decode($form->moduleSettings);
|
$formData = $form->moduleSettings;
|
||||||
|
|
||||||
$code = '<div class="address-widget ' . e($widget->container_class) . '"';
|
$code = '<div class="address-widget ' . e($widget->container_class) . '"';
|
||||||
if ($widget->container_id) {
|
if ($widget->container_id) {
|
||||||
$code .= ' id="' . e($widget->container_id).'"';
|
$code .= ' id="' . e($widget->container_id).'"';
|
||||||
}
|
}
|
||||||
$code .= '>';
|
$code .= '>';
|
||||||
$code .= "<p class='name'>".e($formData->companyName).'</p>';
|
$code .= "<p class='name'>".e($formData['companyName']).'</p>';
|
||||||
$code .= nl2br($formData->address);
|
$code .= nl2br($formData['address']);
|
||||||
$code .= "</div>";
|
$code .= "</div>";
|
||||||
|
|
||||||
return $code;
|
return $code;
|
||||||
|
|||||||
Reference in New Issue
Block a user