diff --git a/src/Laravel/src/Pages/Crud/IndexPage.php b/src/Laravel/src/Pages/Crud/IndexPage.php index 48487f020..bac97e0dd 100644 --- a/src/Laravel/src/Pages/Crud/IndexPage.php +++ b/src/Laravel/src/Pages/Crud/IndexPage.php @@ -86,21 +86,23 @@ protected function bottomLayer(): array { $pageComponents = $this->getResource()->getIndexPageComponents(); - if($this->getResource()->isEditInModal()) { + if ($this->getResource()->isEditInModal()) { $pageComponents[] = Modal::make( __('moonshine::ui.edit'), components: [ Div::make()->customAttributes(['id' => 'resource-edit-modal']), - ]) + ] + ) ->name('resource-edit-modal'); } - if($this->getResource()->isDetailInModal()) { + if ($this->getResource()->isDetailInModal()) { $pageComponents[] = Modal::make( __('moonshine::ui.show'), components: [ Div::make()->customAttributes(['id' => 'resource-detail-modal']), - ]) + ] + ) ->name('resource-detail-modal'); } diff --git a/src/UI/src/Components/Modal.php b/src/UI/src/Components/Modal.php index 9faaac46d..e4765a55a 100644 --- a/src/UI/src/Components/Modal.php +++ b/src/UI/src/Components/Modal.php @@ -97,11 +97,11 @@ public function toggleEvents(array $events, bool $onlyOpening = false, $onlyClos 'data-closing-events' => AlpineJs::prepareEvents($events), ]; - if($onlyOpening) { + if ($onlyOpening) { unset($data['data-closing-events']); } - if($onlyClosing) { + if ($onlyClosing) { unset($data['data-opening-events']); } diff --git a/src/UI/src/Components/OffCanvas.php b/src/UI/src/Components/OffCanvas.php index 500b62c99..23c9ea49d 100644 --- a/src/UI/src/Components/OffCanvas.php +++ b/src/UI/src/Components/OffCanvas.php @@ -67,11 +67,11 @@ public function toggleEvents(array $events, bool $onlyOpening = false, $onlyClos 'data-closing-events' => AlpineJs::prepareEvents($events), ]; - if($onlyOpening) { + if ($onlyOpening) { unset($data['data-closing-events']); } - if($onlyClosing) { + if ($onlyClosing) { unset($data['data-opening-events']); }