From 30bb4c92e736410fbf19546cdc6df981061bbb54 Mon Sep 17 00:00:00 2001 From: Jyrki De Neve Date: Fri, 21 Aug 2026 14:12:23 +0300 Subject: [PATCH 1/3] Upgrade to Filament 4/5, Laravel 12/13 and PHP 8.3+ - Swap codedor/* dependencies for their wotz/* successors (filament-architect v3, laravel-livewire-forms v5, filament-mail-templates v2, filament-translatable-strings v3, filament-translatable-tabs v3, laravel-locale-collection v2, filament-media-library v4) - Replace awcodes/filament-tiptap-editor with Filament's native RichEditor (checkbox-tiptap-profile config renamed to checkbox-toolbar-buttons) - Drop unused guava/filament-drafts dependency (blocked Filament 4/5, only referenced in the test TestCase) - Migrate resources to the Filament 4/5 schema API (Schema signatures, unified Filament\Actions namespace, recordActions/toolbarActions) - Remove the removed HasTranslations page trait (translatable-tabs v3 handles translations in the schema lifecycle) - Make RenderedForm null-safe when mounted without a form - Register LivewireServiceProvider after the Filament providers in tests, so Livewire's DataStore instance binding wins over Filament's DataStoreOverride bind (mirrors production package discovery order) - Pest 4 / PHPUnit 12 / larastan 3 / testbench 10-11; refresh phpunit.xml.dist and phpstan config; CI matrix to PHP 8.3-8.5 x Laravel 12-13 --- .github/workflows/phpstan.yml | 2 +- .github/workflows/run-tests.yml | 4 +- UPGRADING.md | 18 ++++++- composer.json | 42 +++++++-------- config/filament-form-architect.php | 2 +- phpstan.neon.dist | 2 - phpunit.xml.dist | 52 +++++++++--------- .../views/livewire/rendered-form.blade.php | 4 +- src/Architect/BaseFormBlock.php | 2 +- src/Architect/CheckboxBlock.php | 16 +++--- src/Architect/CountryInputBlock.php | 10 ++-- src/Architect/FileInputBlock.php | 14 ++--- src/Architect/RadioButtonBlock.php | 10 ++-- src/Architect/SelectInputBlock.php | 10 ++-- src/Architect/TextInputBlock.php | 14 ++--- src/Architect/TextareaBlock.php | 10 ++-- src/Architect/TitleBlock.php | 16 +++--- .../Actions/ExportFormSubmissions.php | 4 +- src/Filament/Fields/FormArchitectInput.php | 2 +- src/Filament/Resources/FormResource.php | 54 ++++++++++--------- .../Resources/FormSubmissionResource.php | 20 +++---- src/Filament/Resources/Pages/CreateForm.php | 3 -- src/Filament/Resources/Pages/EditForm.php | 3 -- src/Livewire/RenderedForm.php | 12 +++-- src/Mail/SendFormSubmission.php | 5 +- src/Models/Form.php | 5 +- tests/TestCase.php | 29 +++++----- 27 files changed, 192 insertions(+), 173 deletions(-) diff --git a/.github/workflows/phpstan.yml b/.github/workflows/phpstan.yml index 141896e..968560b 100644 --- a/.github/workflows/phpstan.yml +++ b/.github/workflows/phpstan.yml @@ -16,7 +16,7 @@ jobs: - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: "8.3" + php-version: "8.4" coverage: none - name: Install composer dependencies diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 660338a..91878e2 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -13,8 +13,8 @@ jobs: fail-fast: true matrix: os: [ubuntu-latest, windows-latest] - php: [8.2, 8.3] - laravel: [10.*] + php: [8.3, 8.4, 8.5] + laravel: [12.*, 13.*] stability: [prefer-stable] name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }} diff --git a/UPGRADING.md b/UPGRADING.md index c7d86ae..d8b915d 100644 --- a/UPGRADING.md +++ b/UPGRADING.md @@ -1,3 +1,19 @@ # Upgrading -## From vx to vy +## From v1 to v2 + +v2 targets Filament 4/5, Laravel 12/13 and PHP 8.3+, and moves from the `codedor/*` +packages to their `wotz/*` successors. + +- Replace the `codedor/*` dependencies with their `wotz/*` successors. If your project + references their classes directly, replace the `Codedor\` namespace prefix with + `Wotz\` (e.g. `Codedor\LivewireForms\...` becomes `Wotz\LivewireForms\...`). +- `awcodes/filament-tiptap-editor` has been replaced by Filament's native + `RichEditor`. The `checkbox-tiptap-profile` config key has been renamed to + `checkbox-toolbar-buttons` and now takes an array of RichEditor toolbar buttons + (default: `['bold', 'italic', 'link']`). +- `guava/filament-drafts` was an unused dependency and has been dropped. +- The `Wotz\TranslatableTabs\Resources\Traits\HasTranslations` page trait no longer + exists; wotz/filament-translatable-tabs v3 handles translations through the schema + lifecycle. If your project used it on custom Create/Edit pages, delete the `use` + statement. diff --git a/composer.json b/composer.json index 9d6295a..7710d3b 100644 --- a/composer.json +++ b/composer.json @@ -9,30 +9,30 @@ "homepage": "https://github.com/codedor/filament-form-architect", "license": "MIT", "require": { - "php": "^8.2", - "awcodes/filament-tiptap-editor": "^3.2", - "codedor/filament-architect": "^1.0|^2.0", - "codedor/filament-mail-templates": "^1.1", - "codedor/filament-translatable-strings": "^1.0", - "codedor/laravel-livewire-forms": "^4.0", - "codedor/laravel-locale-collection": "^1.1", - "filament/filament": "^3.1", - "guava/filament-drafts": "^2.1", - "maatwebsite/excel": "^3.1", - "illuminate/contracts": "^10.0|^11.0", - "spatie/laravel-package-tools": "^1.12" + "php": "^8.3", + "filament/filament": "^4.0|^5.0", + "illuminate/contracts": "^12.0|^13.0", + "maatwebsite/excel": "^4.0", + "spatie/laravel-package-tools": "^1.12", + "wotz/filament-architect": "^3.0", + "wotz/filament-mail-templates": "^2.0", + "wotz/filament-media-library": "^4.0", + "wotz/filament-translatable-strings": "^3.0", + "wotz/filament-translatable-tabs": "^3.0", + "wotz/laravel-livewire-forms": "^5.0", + "wotz/laravel-locale-collection": "^2.0" }, "require-dev": { + "larastan/larastan": "^3.0", "laravel/pint": "^1.0", - "nunomaduro/collision": "^7.0|^8.0", - "larastan/larastan": "^2.0", - "orchestra/testbench": "^8.0|^9.0", - "pestphp/pest": "^2.0", - "pestphp/pest-plugin-laravel": "^2.0", - "pestphp/pest-plugin-livewire": "^2.1", - "phpstan/extension-installer": "^1.1", - "phpstan/phpstan-deprecation-rules": "^1.0", - "phpstan/phpstan-phpunit": "^1.0" + "nunomaduro/collision": "^8.0", + "orchestra/testbench": "^10.0|^11.0", + "pestphp/pest": "^4.0", + "pestphp/pest-plugin-laravel": "^4.0", + "pestphp/pest-plugin-livewire": "^4.0", + "phpstan/extension-installer": "^1.4", + "phpstan/phpstan-deprecation-rules": "^2.0", + "phpstan/phpstan-phpunit": "^2.0" }, "autoload": { "psr-4": { diff --git a/config/filament-form-architect.php b/config/filament-form-architect.php index 9e9159d..d0f70ff 100644 --- a/config/filament-form-architect.php +++ b/config/filament-form-architect.php @@ -18,5 +18,5 @@ Architect\TextInputBlock::class => [], Architect\TitleBlock::class => [], ], - 'checkbox-tiptap-profile' => 'minimal', + 'checkbox-toolbar-buttons' => ['bold', 'italic', 'link'], ]; diff --git a/phpstan.neon.dist b/phpstan.neon.dist index a91953b..843ce64 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -8,7 +8,5 @@ parameters: - config - database tmpDir: build/phpstan - checkOctaneCompatibility: true checkModelProperties: true - checkMissingIterableValueType: false diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 314c7c5..a698fc5 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,26 +1,30 @@ - - - - tests - - - - - - - - - - - - - - - - - - ./src - - + + + + tests + + + + + + + + ./src + + diff --git a/resources/views/livewire/rendered-form.blade.php b/resources/views/livewire/rendered-form.blade.php index 1cb63e0..487caa7 100644 --- a/resources/views/livewire/rendered-form.blade.php +++ b/resources/views/livewire/rendered-form.blade.php @@ -1,7 +1,7 @@
- @if ($formModel->allowSubmissions()) + @if ($formModel?->allowSubmissions()) @include('livewire-forms::form') @else - {!! $formModel->getMaxSubmissionMessage() !!} + {!! $formModel?->getMaxSubmissionMessage() !!} @endif
diff --git a/src/Architect/BaseFormBlock.php b/src/Architect/BaseFormBlock.php index 2124a7f..c396dcd 100644 --- a/src/Architect/BaseFormBlock.php +++ b/src/Architect/BaseFormBlock.php @@ -2,7 +2,7 @@ namespace Codedor\FormArchitect\Architect; -use Codedor\FilamentArchitect\Filament\Architect\BaseBlock; +use Wotz\FilamentArchitect\Filament\Architect\BaseBlock; class BaseFormBlock extends BaseBlock { diff --git a/src/Architect/CheckboxBlock.php b/src/Architect/CheckboxBlock.php index ee9326c..e74ba8d 100644 --- a/src/Architect/CheckboxBlock.php +++ b/src/Architect/CheckboxBlock.php @@ -2,15 +2,15 @@ namespace Codedor\FormArchitect\Architect; -use Codedor\LivewireForms\Fields\CheckboxField; -use Codedor\LivewireForms\Fields\Field; -use Codedor\TranslatableTabs\Forms\TranslatableTabs; +use Filament\Forms\Components\RichEditor; use Filament\Forms\Components\TextInput; use Filament\Forms\Components\Toggle; -use Filament\Forms\Get; use Filament\Infolists\Components\TextEntry; -use FilamentTiptapEditor\TiptapEditor; +use Filament\Schemas\Components\Utilities\Get; use Illuminate\Support\HtmlString; +use Wotz\LivewireForms\Fields\CheckboxField; +use Wotz\LivewireForms\Fields\Field; +use Wotz\TranslatableTabs\Forms\TranslatableTabs; class CheckboxBlock extends BaseFormBlock { @@ -44,14 +44,14 @@ public function schema(): array { return [ TranslatableTabs::make() - ->persistInQueryString(false) + ->persistTabInQueryString(null) ->defaultFields([ Toggle::make('is_required'), ]) ->translatableFields(fn () => [ - TiptapEditor::make('label') + RichEditor::make('label') ->required(fn (Get $get) => $get('online')) - ->profile(config('filament-form-architect.checkbox-tiptap-profile', 'minimal')), + ->toolbarButtons(config('filament-form-architect.checkbox-toolbar-buttons', ['bold', 'italic', 'link'])), TextInput::make('gdpr_notice') ->label('GDPR Notice') diff --git a/src/Architect/CountryInputBlock.php b/src/Architect/CountryInputBlock.php index b87aab5..e357642 100644 --- a/src/Architect/CountryInputBlock.php +++ b/src/Architect/CountryInputBlock.php @@ -2,15 +2,15 @@ namespace Codedor\FormArchitect\Architect; -use Codedor\LivewireForms\Fields\CountryField; -use Codedor\LivewireForms\Fields\Field; -use Codedor\TranslatableTabs\Forms\TranslatableTabs; use Filament\Forms\Components\Select; use Filament\Forms\Components\TextInput; use Filament\Forms\Components\Toggle; -use Filament\Forms\Get; use Filament\Infolists\Components\TextEntry; +use Filament\Schemas\Components\Utilities\Get; use Illuminate\Support\HtmlString; +use Wotz\LivewireForms\Fields\CountryField; +use Wotz\LivewireForms\Fields\Field; +use Wotz\TranslatableTabs\Forms\TranslatableTabs; class CountryInputBlock extends BaseFormBlock { @@ -46,7 +46,7 @@ public function schema(): array { return [ TranslatableTabs::make() - ->persistInQueryString(false) + ->persistTabInQueryString(null) ->defaultFields([ Select::make('default_value') ->label('Default selected country') diff --git a/src/Architect/FileInputBlock.php b/src/Architect/FileInputBlock.php index b19417d..a217980 100644 --- a/src/Architect/FileInputBlock.php +++ b/src/Architect/FileInputBlock.php @@ -2,17 +2,17 @@ namespace Codedor\FormArchitect\Architect; -use Codedor\LivewireForms\Fields\Field; -use Codedor\LivewireForms\Fields\FileField; -use Codedor\LivewireForms\Fields\MultiFileField; -use Codedor\MediaLibrary\Models\Attachment; -use Codedor\TranslatableTabs\Forms\TranslatableTabs; use Filament\Forms\Components\TextInput; use Filament\Forms\Components\Toggle; -use Filament\Forms\Get; use Filament\Infolists\Components\ViewEntry; +use Filament\Schemas\Components\Utilities\Get; use Illuminate\Support\Collection; use Illuminate\Support\HtmlString; +use Wotz\LivewireForms\Fields\Field; +use Wotz\LivewireForms\Fields\FileField; +use Wotz\LivewireForms\Fields\MultiFileField; +use Wotz\MediaLibrary\Models\Attachment; +use Wotz\TranslatableTabs\Forms\TranslatableTabs; class FileInputBlock extends BaseFormBlock { @@ -55,7 +55,7 @@ public function schema(): array { return [ TranslatableTabs::make() - ->persistInQueryString(false) + ->persistTabInQueryString(null) ->defaultFields([ Toggle::make('multiple') ->helperText('Allow multiple files to be uploaded'), diff --git a/src/Architect/RadioButtonBlock.php b/src/Architect/RadioButtonBlock.php index 46421ec..cd9b0fd 100644 --- a/src/Architect/RadioButtonBlock.php +++ b/src/Architect/RadioButtonBlock.php @@ -2,14 +2,14 @@ namespace Codedor\FormArchitect\Architect; -use Codedor\LivewireForms\Fields\Field; -use Codedor\LivewireForms\Fields\RadioGroup; -use Codedor\TranslatableTabs\Forms\TranslatableTabs; use Filament\Forms\Components\Repeater; use Filament\Forms\Components\TextInput; use Filament\Forms\Components\Toggle; -use Filament\Forms\Get; +use Filament\Schemas\Components\Utilities\Get; use Illuminate\Support\HtmlString; +use Wotz\LivewireForms\Fields\Field; +use Wotz\LivewireForms\Fields\RadioGroup; +use Wotz\TranslatableTabs\Forms\TranslatableTabs; class RadioButtonBlock extends BaseFormBlock { @@ -38,7 +38,7 @@ public function schema(): array { return [ TranslatableTabs::make() - ->persistInQueryString(false) + ->persistTabInQueryString(null) ->defaultFields([ Toggle::make('is_required'), ]) diff --git a/src/Architect/SelectInputBlock.php b/src/Architect/SelectInputBlock.php index dc23118..3c926de 100644 --- a/src/Architect/SelectInputBlock.php +++ b/src/Architect/SelectInputBlock.php @@ -2,14 +2,14 @@ namespace Codedor\FormArchitect\Architect; -use Codedor\LivewireForms\Fields\Field; -use Codedor\LivewireForms\Fields\SelectField; -use Codedor\TranslatableTabs\Forms\TranslatableTabs; use Filament\Forms\Components\Repeater; use Filament\Forms\Components\TextInput; use Filament\Forms\Components\Toggle; -use Filament\Forms\Get; +use Filament\Schemas\Components\Utilities\Get; use Illuminate\Support\HtmlString; +use Wotz\LivewireForms\Fields\Field; +use Wotz\LivewireForms\Fields\SelectField; +use Wotz\TranslatableTabs\Forms\TranslatableTabs; class SelectInputBlock extends BaseFormBlock { @@ -38,7 +38,7 @@ public function schema(): array { return [ TranslatableTabs::make() - ->persistInQueryString(false) + ->persistTabInQueryString(null) ->defaultFields([ Toggle::make('is_required'), ]) diff --git a/src/Architect/TextInputBlock.php b/src/Architect/TextInputBlock.php index 495d326..27f2010 100644 --- a/src/Architect/TextInputBlock.php +++ b/src/Architect/TextInputBlock.php @@ -2,15 +2,15 @@ namespace Codedor\FormArchitect\Architect; -use Codedor\LivewireForms\Fields\Field; -use Codedor\LivewireForms\Fields\TextField; -use Codedor\TranslatableTabs\Forms\TranslatableTabs; +use Filament\Forms\Components\RichEditor; use Filament\Forms\Components\Select; use Filament\Forms\Components\TextInput; use Filament\Forms\Components\Toggle; -use Filament\Forms\Get; -use FilamentTiptapEditor\TiptapEditor; +use Filament\Schemas\Components\Utilities\Get; use Illuminate\Support\HtmlString; +use Wotz\LivewireForms\Fields\Field; +use Wotz\LivewireForms\Fields\TextField; +use Wotz\TranslatableTabs\Forms\TranslatableTabs; class TextInputBlock extends BaseFormBlock { @@ -36,7 +36,7 @@ public function schema(): array { return [ TranslatableTabs::make() - ->persistInQueryString(false) + ->persistTabInQueryString(null) ->defaultFields([ Select::make('type') ->selectablePlaceholder(false) @@ -56,7 +56,7 @@ public function schema(): array TextInput::make('label') ->required(fn (Get $get) => $get('online')), - TiptapEditor::make('gdpr_notice') + RichEditor::make('gdpr_notice') ->label('GDPR Notice') ->helperText('This will explain why you need this information and how you will use it.'), diff --git a/src/Architect/TextareaBlock.php b/src/Architect/TextareaBlock.php index c820420..2b60519 100644 --- a/src/Architect/TextareaBlock.php +++ b/src/Architect/TextareaBlock.php @@ -2,13 +2,13 @@ namespace Codedor\FormArchitect\Architect; -use Codedor\LivewireForms\Fields\Field; -use Codedor\LivewireForms\Fields\TextareaField; -use Codedor\TranslatableTabs\Forms\TranslatableTabs; use Filament\Forms\Components\TextInput; use Filament\Forms\Components\Toggle; -use Filament\Forms\Get; +use Filament\Schemas\Components\Utilities\Get; use Illuminate\Support\HtmlString; +use Wotz\LivewireForms\Fields\Field; +use Wotz\LivewireForms\Fields\TextareaField; +use Wotz\TranslatableTabs\Forms\TranslatableTabs; class TextareaBlock extends BaseFormBlock { @@ -43,7 +43,7 @@ public function schema(): array { return [ TranslatableTabs::make() - ->persistInQueryString(false) + ->persistTabInQueryString(null) ->defaultFields([ TextInput::make('max') ->label('Maximum allowed characters') diff --git a/src/Architect/TitleBlock.php b/src/Architect/TitleBlock.php index fcd3f3f..e483b9c 100644 --- a/src/Architect/TitleBlock.php +++ b/src/Architect/TitleBlock.php @@ -2,14 +2,14 @@ namespace Codedor\FormArchitect\Architect; -use Codedor\LivewireForms\Fields\Field; -use Codedor\LivewireForms\Fields\Title; -use Codedor\TranslatableTabs\Forms\TranslatableTabs; +use Filament\Forms\Components\RichEditor; use Filament\Forms\Components\Select; use Filament\Forms\Components\Toggle; -use Filament\Forms\Get; -use FilamentTiptapEditor\TiptapEditor; +use Filament\Schemas\Components\Utilities\Get; use Illuminate\Support\HtmlString; +use Wotz\LivewireForms\Fields\Field; +use Wotz\LivewireForms\Fields\Title; +use Wotz\TranslatableTabs\Forms\TranslatableTabs; class TitleBlock extends BaseFormBlock { @@ -27,7 +27,7 @@ public function schema(): array { return [ TranslatableTabs::make() - ->persistInQueryString(false) + ->persistTabInQueryString(null) ->defaultFields([ Select::make('tag') ->label('Styling') @@ -41,8 +41,8 @@ public function schema(): array ]), ]) ->translatableFields(fn () => [ - TiptapEditor::make('label') - ->tools(['link']) + RichEditor::make('label') + ->toolbarButtons(['link']) ->required(fn (Get $get) => $get('online')), Toggle::make('online'), diff --git a/src/Filament/Actions/ExportFormSubmissions.php b/src/Filament/Actions/ExportFormSubmissions.php index 86df12e..1c61f16 100644 --- a/src/Filament/Actions/ExportFormSubmissions.php +++ b/src/Filament/Actions/ExportFormSubmissions.php @@ -3,9 +3,9 @@ namespace Codedor\FormArchitect\Filament\Actions; use Codedor\FormArchitect\Exports\FormSubmissionsExport; +use Filament\Actions\BulkAction; use Filament\Forms\Components\Select; use Filament\Forms\Components\TextInput; -use Filament\Tables\Actions\BulkAction; use Illuminate\Support\Collection; use Maatwebsite\Excel\Facades\Excel; @@ -24,7 +24,7 @@ protected function setUp(): void $this->icon('heroicon-o-arrow-down-tray'); - $this->form(fn () => [ + $this->schema(fn () => [ TextInput::make('filename') ->label('Filename') ->default('form-submissions'), diff --git a/src/Filament/Fields/FormArchitectInput.php b/src/Filament/Fields/FormArchitectInput.php index e7a613f..d5db78f 100644 --- a/src/Filament/Fields/FormArchitectInput.php +++ b/src/Filament/Fields/FormArchitectInput.php @@ -3,7 +3,7 @@ namespace Codedor\FormArchitect\Filament\Fields; use Closure; -use Codedor\FilamentArchitect\Filament\Fields\ArchitectInput; +use Wotz\FilamentArchitect\Filament\Fields\ArchitectInput; class FormArchitectInput extends ArchitectInput { diff --git a/src/Filament/Resources/FormResource.php b/src/Filament/Resources/FormResource.php index e6abfab..eb5333d 100644 --- a/src/Filament/Resources/FormResource.php +++ b/src/Filament/Resources/FormResource.php @@ -2,45 +2,47 @@ namespace Codedor\FormArchitect\Filament\Resources; -use Codedor\FilamentMailTemplates\Facades\MailTemplateFallbacks; use Codedor\FormArchitect\Filament\Fields\FormArchitectInput; +use Codedor\FormArchitect\Models\Form; use Codedor\FormArchitect\Models\Form as ModelsForm; -use Codedor\TranslatableTabs\Forms\TranslatableTabs; -use Filament\Forms; -use Filament\Forms\Components\Grid; +use Filament\Actions\Action; +use Filament\Actions\DeleteAction; +use Filament\Actions\EditAction; use Filament\Forms\Components\Repeater; +use Filament\Forms\Components\RichEditor; use Filament\Forms\Components\Select; use Filament\Forms\Components\TextInput; -use Filament\Forms\Form; -use Filament\Infolists\Components\Section; use Filament\Infolists\Components\TextEntry; -use Filament\Infolists\Infolist; use Filament\Resources\Resource; +use Filament\Schemas\Components\Grid; +use Filament\Schemas\Components\Section; +use Filament\Schemas\Schema; use Filament\Tables; use Filament\Tables\Table; -use FilamentTiptapEditor\TiptapEditor; +use Wotz\FilamentMailTemplates\Facades\MailTemplateFallbacks; +use Wotz\TranslatableTabs\Forms\TranslatableTabs; class FormResource extends Resource { - protected static ?string $model = \Codedor\FormArchitect\Models\Form::class; + protected static ?string $model = Form::class; - protected static ?string $navigationIcon = 'heroicon-o-pencil-square'; + protected static string|\BackedEnum|null $navigationIcon = 'heroicon-o-pencil-square'; protected static ?string $modelLabel = 'Custom Form'; - public static function form(Form $form): Form + public static function form(Schema $schema): Schema { - return $form - ->schema([ + return $schema + ->components([ TranslatableTabs::make() ->icon('heroicon-o-check-circle') ->defaultFields([ - Forms\Components\TextInput::make('name') + TextInput::make('name') ->label('Form name') ->required() ->maxLength(255), - Forms\Components\TextInput::make('email_from') + TextInput::make('email_from') ->label('Admin mail sender address') ->helperText( 'If left empty, the sites default mail will be used: ' . @@ -69,7 +71,7 @@ public static function form(Form $form): Form ]) ->hidden(ModelsForm::adminEmailsDisabled()), - Forms\Components\TextInput::make('max_submissions') + TextInput::make('max_submissions') ->required() ->numeric() ->default(0) @@ -79,19 +81,19 @@ public static function form(Form $form): Form FormArchitectInput::make('fields'), ]) ->translatableFields(fn () => [ - Forms\Components\TextInput::make('email_subject') + TextInput::make('email_subject') ->label('E-mail subject') ->hidden(ModelsForm::adminEmailsDisabled()), - TiptapEditor::make('email_body') + RichEditor::make('email_body') ->label('E-mail body') ->hidden(ModelsForm::adminEmailsDisabled()), - TiptapEditor::make('completion_message') + RichEditor::make('completion_message') ->label('After submit completion message') ->helperText('This message will be shown to the user after submitting the form.'), - TiptapEditor::make('max_submissions_message') + RichEditor::make('max_submissions_message') ->label('Maximum submissions message') ->helperText('This message will be shown to the user when the maximum amount of submissions has been reached.') ->hidden(ModelsForm::maxSubmissionsDisabled()), @@ -125,20 +127,20 @@ public static function table(Table $table): Table ->sortable() ->getStateUsing(fn ($record) => $record->submissions()->count()), ]) - ->actions([ - Tables\Actions\Action::make('submissions') + ->recordActions([ + Action::make('submissions') ->url(fn ($record): string => self::getUrl('submissions', [$record])) ->color('gray') ->icon('heroicon-s-eye'), - Tables\Actions\EditAction::make(), - Tables\Actions\DeleteAction::make(), + EditAction::make(), + DeleteAction::make(), ]); } - public static function infolist(Infolist $infolist): Infolist + public static function infolist(Schema $schema): Schema { - return $infolist->schema([ + return $schema->components([ Section::make()->schema([ TextEntry::make('name')->label('Form'), diff --git a/src/Filament/Resources/FormSubmissionResource.php b/src/Filament/Resources/FormSubmissionResource.php index 11e3694..b2002bd 100644 --- a/src/Filament/Resources/FormSubmissionResource.php +++ b/src/Filament/Resources/FormSubmissionResource.php @@ -4,22 +4,24 @@ use Codedor\FormArchitect\Filament\Actions\ExportFormSubmissions; use Codedor\FormArchitect\Models\FormSubmission; -use Filament\Infolists\Components\Section; +use Filament\Actions\DeleteBulkAction; +use Filament\Actions\ViewAction; use Filament\Infolists\Components\TextEntry; -use Filament\Infolists\Infolist; use Filament\Resources\Resource; +use Filament\Schemas\Components\Section; +use Filament\Schemas\Schema; use Filament\Tables; use Filament\Tables\Table; class FormSubmissionResource extends Resource { - protected static ?string $model = \Codedor\FormArchitect\Models\FormSubmission::class; + protected static ?string $model = FormSubmission::class; protected static bool $shouldRegisterNavigation = false; - public static function infolist(Infolist $infolist): Infolist + public static function infolist(Schema $schema): Schema { - return $infolist->schema([ + return $schema->components([ TextEntry::make('created_at') ->dateTime(), @@ -43,12 +45,12 @@ public static function table(Table $table): Table ->sortable(), ]) ->defaultSort('id', 'desc') - ->actions([ - Tables\Actions\ViewAction::make(), + ->recordActions([ + ViewAction::make(), ]) - ->bulkActions([ + ->toolbarActions([ ExportFormSubmissions::make(), - Tables\Actions\DeleteBulkAction::make(), + DeleteBulkAction::make(), ]); } diff --git a/src/Filament/Resources/Pages/CreateForm.php b/src/Filament/Resources/Pages/CreateForm.php index 377c845..be72600 100644 --- a/src/Filament/Resources/Pages/CreateForm.php +++ b/src/Filament/Resources/Pages/CreateForm.php @@ -3,12 +3,9 @@ namespace Codedor\FormArchitect\Filament\Resources\Pages; use Codedor\FormArchitect\Filament\Resources\FormResource; -use Codedor\TranslatableTabs\Resources\Traits\HasTranslations; use Filament\Resources\Pages\CreateRecord; class CreateForm extends CreateRecord { - use HasTranslations; - protected static string $resource = FormResource::class; } diff --git a/src/Filament/Resources/Pages/EditForm.php b/src/Filament/Resources/Pages/EditForm.php index a329286..f879b02 100644 --- a/src/Filament/Resources/Pages/EditForm.php +++ b/src/Filament/Resources/Pages/EditForm.php @@ -3,14 +3,11 @@ namespace Codedor\FormArchitect\Filament\Resources\Pages; use Codedor\FormArchitect\Filament\Resources\FormResource; -use Codedor\TranslatableTabs\Resources\Traits\HasTranslations; use Filament\Actions; use Filament\Resources\Pages\EditRecord; class EditForm extends EditRecord { - use HasTranslations; - protected static string $resource = FormResource::class; protected function getHeaderActions(): array diff --git a/src/Livewire/RenderedForm.php b/src/Livewire/RenderedForm.php index 4e2fcda..82e2b08 100644 --- a/src/Livewire/RenderedForm.php +++ b/src/Livewire/RenderedForm.php @@ -5,11 +5,11 @@ use Codedor\FormArchitect\Mail\SendFormSubmission; use Codedor\FormArchitect\Models\Form; use Codedor\FormArchitect\Models\FormSubmission; -use Codedor\LivewireForms\Fields\Button; -use Codedor\LivewireForms\Form as LivewireFormsForm; -use Codedor\LivewireForms\FormController; use Illuminate\Support\Facades\Mail; use Illuminate\Support\HtmlString; +use Wotz\LivewireForms\Fields\Button; +use Wotz\LivewireForms\Form as LivewireFormsForm; +use Wotz\LivewireForms\FormController; class RenderedForm extends FormController { @@ -80,13 +80,17 @@ public function getForm() { return new class($this->formModel) extends LivewireFormsForm { - public function __construct(public Form $formModel) + public function __construct(public ?Form $formModel) { parent::__construct(); } public function fields() { + if (! $this->formModel) { + return []; + } + return [ ...$this->formModel->getLivewireFormFields(), Button::make(__('form.submit')), diff --git a/src/Mail/SendFormSubmission.php b/src/Mail/SendFormSubmission.php index 5e018fd..af12117 100644 --- a/src/Mail/SendFormSubmission.php +++ b/src/Mail/SendFormSubmission.php @@ -2,17 +2,18 @@ namespace Codedor\FormArchitect\Mail; -use Codedor\FilamentMailTemplates\Models\MailTemplate; use Codedor\FormArchitect\Filament\Resources\FormResource; use Codedor\FormArchitect\Models\Form; use Codedor\FormArchitect\Models\FormSubmission; use Illuminate\Bus\Queueable; use Illuminate\Mail\Mailable; use Illuminate\Mail\Mailables\Address; +use Illuminate\Mail\Mailables\Attachment; use Illuminate\Mail\Mailables\Content; use Illuminate\Mail\Mailables\Envelope; use Illuminate\Queue\SerializesModels; use Illuminate\Support\HtmlString; +use Wotz\FilamentMailTemplates\Models\MailTemplate; class SendFormSubmission extends Mailable { @@ -62,7 +63,7 @@ public function content(): Content /** * Get the attachments for the message. * - * @return array + * @return array */ public function attachments(): array { diff --git a/src/Models/Form.php b/src/Models/Form.php index e79c68d..a1d7fa2 100644 --- a/src/Models/Form.php +++ b/src/Models/Form.php @@ -2,14 +2,15 @@ namespace Codedor\FormArchitect\Models; -use Codedor\FilamentMailTemplates\Facades\MailTemplateFallbacks; +use Carbon\Carbon; use Codedor\FormArchitect\Database\Factories\FormFactory; -use Codedor\LivewireForms\Fields\Row; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; use Illuminate\Support\Collection; use Illuminate\Support\HtmlString; use Spatie\Translatable\HasTranslations; +use Wotz\FilamentMailTemplates\Facades\MailTemplateFallbacks; +use Wotz\LivewireForms\Fields\Row; /** * @property int $id diff --git a/tests/TestCase.php b/tests/TestCase.php index b879bbb..498884a 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -4,25 +4,25 @@ use BladeUI\Heroicons\BladeHeroiconsServiceProvider; use BladeUI\Icons\BladeIconsServiceProvider; -use Codedor\FilamentArchitect\Providers\FilamentArchitectServiceProvider; -use Codedor\FilamentMailTemplates\Providers\FilamentMailTemplatesServiceProvider; use Codedor\FormArchitect\Filament\FormArchitectPlugin; use Codedor\FormArchitect\Providers\FormArchitectServiceProvider; -use Codedor\LivewireForms\LivewireFormsServiceProvider; use Filament\Actions\ActionsServiceProvider; +use Filament\Facades\Filament; use Filament\FilamentServiceProvider; -use Filament\FilamentServiceProvider as BaseFilamentServiceProvider; use Filament\Forms\FormsServiceProvider; +use Filament\Infolists\InfolistsServiceProvider; use Filament\Notifications\NotificationsServiceProvider; +use Filament\Panel; +use Filament\Schemas\SchemasServiceProvider; use Filament\Support\SupportServiceProvider; use Filament\Tables\TablesServiceProvider; use Filament\Widgets\WidgetsServiceProvider; -use Guava\FilamentDrafts\FilamentDraftsServiceProvider; use Illuminate\Database\Eloquent\Factories\Factory; use Livewire\LivewireServiceProvider; -use Oddvalue\LaravelDrafts\LaravelDraftsServiceProvider; use Orchestra\Testbench\TestCase as Orchestra; -use RyanChandler\BladeCaptureDirective\BladeCaptureDirectiveServiceProvider; +use Wotz\FilamentArchitect\Providers\FilamentArchitectServiceProvider; +use Wotz\FilamentMailTemplates\Providers\FilamentMailTemplatesServiceProvider; +use Wotz\LivewireForms\LivewireFormsServiceProvider; class TestCase extends Orchestra { @@ -40,21 +40,18 @@ protected function getPackageProviders($app) return [ FilamentArchitectServiceProvider::class, FormArchitectServiceProvider::class, - LivewireServiceProvider::class, - FilamentServiceProvider::class, - BladeCaptureDirectiveServiceProvider::class, BladeHeroiconsServiceProvider::class, BladeIconsServiceProvider::class, - BaseFilamentServiceProvider::class, + FilamentServiceProvider::class, + SchemasServiceProvider::class, + InfolistsServiceProvider::class, FormsServiceProvider::class, ActionsServiceProvider::class, WidgetsServiceProvider::class, - LivewireServiceProvider::class, NotificationsServiceProvider::class, SupportServiceProvider::class, TablesServiceProvider::class, - FilamentDraftsServiceProvider::class, - LaravelDraftsServiceProvider::class, + LivewireServiceProvider::class, LivewireFormsServiceProvider::class, FilamentMailTemplatesServiceProvider::class, ]; @@ -64,13 +61,13 @@ public function getEnvironmentSetUp($app) { config()->set('database.default', 'testing'); - $panel = new \Filament\Panel; + $panel = new Panel; $panel ->id('resource-test') ->default(true) ->plugin(FormArchitectPlugin::make()); - \Filament\Facades\Filament::registerPanel($panel); + Filament::registerPanel($panel); } protected function defineDatabaseMigrations(): void From dbf4f149bb67c305f3710120992fdb560b2e2687 Mon Sep 17 00:00:00 2001 From: Jyrki De Neve Date: Fri, 21 Aug 2026 14:39:04 +0300 Subject: [PATCH 2/3] Rename package to wotz/filament-form-architect for the wotzebra org move - Codedor\FormArchitect namespace becomes Wotz\FormArchitect - composer name codedor/filament-form-architect -> wotz/filament-form-architect - Repo/branding references point to the wotzebra organisation - UPGRADING.md documents the rename for consuming projects --- .github/workflows/ISSUE_TEMPLATE/config.yml | 8 ++++---- CODE_OF_CONDUCT.md | 2 +- CONTRIBUTING.md | 2 +- README.md | 8 ++++---- UPGRADING.md | 14 +++++++++----- composer.json | 14 +++++++------- config/filament-form-architect.php | 2 +- database/factories/FormFactory.php | 4 ++-- database/seeders/FormSeeder.php | 2 +- docs/index.md | 14 +++++++------- phpunit.xml.dist | 2 +- src/Architect/BaseFormBlock.php | 2 +- src/Architect/CheckboxBlock.php | 2 +- src/Architect/CountryInputBlock.php | 2 +- src/Architect/FileInputBlock.php | 2 +- src/Architect/RadioButtonBlock.php | 2 +- src/Architect/SelectInputBlock.php | 2 +- src/Architect/TextInputBlock.php | 2 +- src/Architect/TextareaBlock.php | 2 +- src/Architect/TitleBlock.php | 2 +- src/Exports/FormSubmissionsExport.php | 4 ++-- src/Filament/Actions/ExportFormSubmissions.php | 4 ++-- src/Filament/Fields/FormArchitectInput.php | 2 +- src/Filament/FormArchitectPlugin.php | 6 +++--- src/Filament/Resources/FormResource.php | 8 ++++---- src/Filament/Resources/FormSubmissionResource.php | 6 +++--- src/Filament/Resources/Pages/CreateForm.php | 4 ++-- src/Filament/Resources/Pages/EditForm.php | 4 ++-- .../Resources/Pages/ListFormSubmissions.php | 6 +++--- src/Filament/Resources/Pages/ListForms.php | 4 ++-- src/Filament/Resources/Pages/ViewForm.php | 4 ++-- src/Livewire/RenderedForm.php | 8 ++++---- src/Mail/SendFormSubmission.php | 8 ++++---- src/Models/Form.php | 4 ++-- src/Models/FormSubmission.php | 2 +- src/Providers/FormArchitectServiceProvider.php | 4 ++-- .../Filament/FormResource/Pages/CreateFormTest.php | 6 +++--- tests/Feature/Filament/FormResourceTest.php | 4 ++-- tests/Feature/Livewire/RenderedFormTest.php | 10 +++++----- tests/Fixtures/Database/Factories/UserFactory.php | 4 ++-- tests/Fixtures/Models/User.php | 4 ++-- tests/Pest.php | 2 +- tests/TestCase.php | 8 ++++---- 43 files changed, 105 insertions(+), 101 deletions(-) diff --git a/.github/workflows/ISSUE_TEMPLATE/config.yml b/.github/workflows/ISSUE_TEMPLATE/config.yml index 399bc7b..8562769 100644 --- a/.github/workflows/ISSUE_TEMPLATE/config.yml +++ b/.github/workflows/ISSUE_TEMPLATE/config.yml @@ -1,14 +1,14 @@ blank_issues_enabled: false contact_links: - name: Feature request - url: https://github.com/codedor/filament-form-architect/discussions/new?category=ideas + url: https://github.com/wotz/filament-form-architect/discussions/new?category=ideas about: Share ideas for new features - name: Support question - url: https://github.com/codedor/filament-form-architect/discussions/new?category=q-a + url: https://github.com/wotz/filament-form-architect/discussions/new?category=q-a about: Ask the community for help - name: Report a security issue - url: https://github.com/codedor/filament-form-architect/README.md#security + url: https://github.com/wotz/filament-form-architect/README.md#security about: Learn how to notify us for sensitive bugs - name: Report a bug - url: https://github.com/codedor/filament-form-architect/issues/new + url: https://github.com/wotz/filament-form-architect/issues/new about: Report a reproducable bug diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index 6869745..bdc9485 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -60,7 +60,7 @@ representative at an online or offline event. Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at -info@codedor.be. +info@whoownsthezebra.be. All complaints will be reviewed and investigated promptly and fairly. All community leaders are obligated to respect the privacy and security of the diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7d1294e..c9feb57 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -45,7 +45,7 @@ Some things to consider before submitting an issue ## Coding style -See our [guidelines](https://guidelines.codedor.be/coding-standards/php). +See our [guidelines](https://guidelines.whoownsthezebra.be/coding-standards/php). ### Laravel Pint diff --git a/README.md b/README.md index 37438d0..41c0bc0 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ This is where your description should go. Limit it to a paragraph or two. Consid You can install the package via composer: ```bash -composer require codedor/filament-form-architect +composer require wotz/filament-form-architect ``` You can publish and run the migrations with: @@ -30,8 +30,8 @@ This is the contents of the published config file: ```php return [ 'default-blocks' => [ - \Codedor\FormArchitect\Architect\RadioButtonBlock::class, - \Codedor\FormArchitect\Architect\TextInputBlock::class, + \Wotz\FormArchitect\Architect\RadioButtonBlock::class, + \Wotz\FormArchitect\Architect\TextInputBlock::class, ], ]; ``` @@ -66,7 +66,7 @@ Please see [CONTRIBUTING](CONTRIBUTING.md) for details. ## Security Vulnerabilities -If you discover any security-related issues, please email info@codedor.be instead of using the issue tracker. +If you discover any security-related issues, please email info@whoownsthezebra.be instead of using the issue tracker. ## License diff --git a/UPGRADING.md b/UPGRADING.md index d8b915d..297ae4d 100644 --- a/UPGRADING.md +++ b/UPGRADING.md @@ -2,12 +2,16 @@ ## From v1 to v2 -v2 targets Filament 4/5, Laravel 12/13 and PHP 8.3+, and moves from the `codedor/*` -packages to their `wotz/*` successors. +v2 moves the package to the wotzebra organisation, targets Filament 4/5, +Laravel 12/13 and PHP 8.3+, and swaps the `codedor/*` dependencies for their +`wotz/*` successors. -- Replace the `codedor/*` dependencies with their `wotz/*` successors. If your project - references their classes directly, replace the `Codedor\` namespace prefix with - `Wotz\` (e.g. `Codedor\LivewireForms\...` becomes `Wotz\LivewireForms\...`). +- Install `wotz/filament-form-architect` instead of `codedor/filament-form-architect`. +- Replace all occurrences of the `Codedor\FormArchitect` namespace with the new + `Wotz\FormArchitect` namespace. +- If your project references classes of the underlying `codedor/*` packages + directly, replace their `Codedor\` namespace prefix with `Wotz\` as well + (e.g. `Codedor\LivewireForms\...` becomes `Wotz\LivewireForms\...`). - `awcodes/filament-tiptap-editor` has been replaced by Filament's native `RichEditor`. The `checkbox-tiptap-profile` config key has been renamed to `checkbox-toolbar-buttons` and now takes an array of RichEditor toolbar buttons diff --git a/composer.json b/composer.json index 7710d3b..89c9055 100644 --- a/composer.json +++ b/composer.json @@ -1,12 +1,12 @@ { - "name": "codedor/filament-form-architect", + "name": "wotz/filament-form-architect", "description": "Build beautiful forms together with our Architect package", "keywords": [ - "codedor", + "who owns the zebra", "laravel", "filament-form-architect" ], - "homepage": "https://github.com/codedor/filament-form-architect", + "homepage": "https://github.com/wotz/filament-form-architect", "license": "MIT", "require": { "php": "^8.3", @@ -36,19 +36,19 @@ }, "autoload": { "psr-4": { - "Codedor\\FormArchitect\\": "src", - "Codedor\\FormArchitect\\Database\\Factories\\": "database/factories" + "Wotz\\FormArchitect\\": "src", + "Wotz\\FormArchitect\\Database\\Factories\\": "database/factories" } }, "autoload-dev": { "psr-4": { - "Codedor\\FormArchitect\\Tests\\": "tests" + "Wotz\\FormArchitect\\Tests\\": "tests" } }, "extra": { "laravel": { "providers": [ - "Codedor\\FormArchitect\\Providers\\FormArchitectServiceProvider" + "Wotz\\FormArchitect\\Providers\\FormArchitectServiceProvider" ] } }, diff --git a/config/filament-form-architect.php b/config/filament-form-architect.php index d0f70ff..67e5111 100644 --- a/config/filament-form-architect.php +++ b/config/filament-form-architect.php @@ -1,6 +1,6 @@ false, diff --git a/database/factories/FormFactory.php b/database/factories/FormFactory.php index 4df552f..e3da37c 100644 --- a/database/factories/FormFactory.php +++ b/database/factories/FormFactory.php @@ -1,9 +1,9 @@ plugins([ - \Codedor\FormArchitect\Filament\FormArchitectPlugin::make(), + \Wotz\FormArchitect\Filament\FormArchitectPlugin::make(), ]); } @@ -48,7 +48,7 @@ public function panel(Panel $panel): Panel ## Creating a block/field -See our [Architect](https://github.com/codedor/filament-architect) package for how to create new blocks. +See our [Architect](https://github.com/wotzebra/filament-architect) package for how to create new blocks. The only difference here is that we have a `toLivewireForm` function instead of a `render` function, which returns the Livewire form component. @@ -87,7 +87,7 @@ public static function toExcelExport(mixed $value): string This package has a couple of config values: ```php -use Codedor\FormArchitect\Architect; +use Wotz\FormArchitect\Architect; return [ 'enable-submission-field' => false, @@ -118,7 +118,7 @@ This configures the default attributes for the row block. For example the `divCl ### default-blocks -This configures which blocks will be used in the form builder, see our [Architect](https://github.com/codedor/filament-architect) package for more information about blocks. +This configures which blocks will be used in the form builder, see our [Architect](https://github.com/wotzebra/filament-architect) package for more information about blocks. A slight difference with the normal Architect blocks is that we can pass an array per block, which will be used as the default attributes for that block. For example: @@ -132,7 +132,7 @@ A slight difference with the normal Architect blocks is that we can pass an arra ], ``` -See our [Livewire Forms](https://github.com/codedor/laravel-livewire-forms) package for an overview of available attributes. +See our [Livewire Forms](https://github.com/wotzebra/laravel-livewire-forms) package for an overview of available attributes. ### checkbox-tiptap-profile diff --git a/phpunit.xml.dist b/phpunit.xml.dist index a698fc5..11e4917 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -15,7 +15,7 @@ backupStaticProperties="false" > - + tests diff --git a/src/Architect/BaseFormBlock.php b/src/Architect/BaseFormBlock.php index c396dcd..99db0cd 100644 --- a/src/Architect/BaseFormBlock.php +++ b/src/Architect/BaseFormBlock.php @@ -1,6 +1,6 @@ actingAs(User::factory()->create()); diff --git a/tests/Feature/Livewire/RenderedFormTest.php b/tests/Feature/Livewire/RenderedFormTest.php index eecd5fe..9f1d1d0 100644 --- a/tests/Feature/Livewire/RenderedFormTest.php +++ b/tests/Feature/Livewire/RenderedFormTest.php @@ -1,12 +1,12 @@ in('Feature'); diff --git a/tests/TestCase.php b/tests/TestCase.php index 498884a..03606c7 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -1,11 +1,9 @@ 'Codedor\\FormArchitect\\Database\\Factories\\' . class_basename($modelName) . 'Factory' + fn (string $modelName) => 'Wotz\\FormArchitect\\Database\\Factories\\' . class_basename($modelName) . 'Factory' ); } From 319591ba68bfe02063d3ae2518ce3a41020e33e0 Mon Sep 17 00:00:00 2001 From: Jyrki De Neve Date: Mon, 24 Aug 2026 11:57:57 +0300 Subject: [PATCH 3/3] Fix ListFormSubmissions when opened without a parent form record The page's $record property was never assigned in mount() and the typed property blew up on direct visits to the submissions index. Assign the optionally-bound record and only scope the query when one is present. Claude-Session: https://claude.ai/code/session_01RiAkKQ4ZMzoRPkTms5Bi1i --- src/Filament/Resources/Pages/ListFormSubmissions.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Filament/Resources/Pages/ListFormSubmissions.php b/src/Filament/Resources/Pages/ListFormSubmissions.php index 54973da..a66541a 100644 --- a/src/Filament/Resources/Pages/ListFormSubmissions.php +++ b/src/Filament/Resources/Pages/ListFormSubmissions.php @@ -11,15 +11,18 @@ class ListFormSubmissions extends ListRecords { protected static string $resource = FormSubmissionResource::class; - public Form $record; + public ?Form $record = null; public function mount(?Form $record = null): void { + $this->record = $record; + parent::mount(); } public function getFilteredTableQuery(): Builder { - return parent::getFilteredTableQuery()->where('form_id', $this->record->id); + return parent::getFilteredTableQuery() + ->when($this->record, fn (Builder $query) => $query->where('form_id', $this->record->id)); } }