diff --git a/README.md b/README.md index 7778a0c..eb7ad2e 100644 --- a/README.md +++ b/README.md @@ -195,7 +195,7 @@ The `data` array contains the form data, and the `state` array contains the full ### Customizing modal's appearance -You can customize modal's title, size and the labels for save and cancel buttons: +You can customize modal's title, size and the labels for save and cancel buttons, or use Filament's slide-over instead of a modal: ```php protected string $editModalTitle = 'Edit Record'; @@ -205,6 +205,8 @@ protected string $editModalWidth = '2xl'; protected string $editModalSaveButtonLabel = 'Save'; protected string $editModalCancelButtonLabel = 'Cancel'; + +protected bool $editModalSlideOver = true; ``` ## Customization diff --git a/resources/views/components/edit-record-modal.blade.php b/resources/views/components/edit-record-modal.blade.php index 44c1ca1..e5e68c7 100644 --- a/resources/views/components/edit-record-modal.blade.php +++ b/resources/views/components/edit-record-modal.blade.php @@ -1,5 +1,5 @@ - + {{ $this->getEditModalTitle() }} diff --git a/src/Concerns/HasEditRecordModal.php b/src/Concerns/HasEditRecordModal.php index dcd179f..450ba5e 100644 --- a/src/Concerns/HasEditRecordModal.php +++ b/src/Concerns/HasEditRecordModal.php @@ -15,6 +15,8 @@ trait HasEditRecordModal protected string $editModalTitle = 'Edit Record'; + protected bool $editModalSlideOver = false; + protected string $editModalWidth = '2xl'; protected string $editModalSaveButtonLabel = 'Save'; @@ -81,6 +83,11 @@ protected function getEditModalTitle(): string return $this->editModalTitle; } + protected function getEditModalSlideOver(): bool + { + return $this->editModalSlideOver; + } + protected function getEditModalWidth(): string { return $this->editModalWidth;