2l30926048
Missing required parameter for edit route redirect after creation error
Finally I found the answer to the problem thanks to @awcodes
it was solved here https://github.com/filamentphp/filament/issues/7592#issuecomment-1671997859
Basically somehow the models were extending the wrong class (Pivot instead of Model).
Thanks everyone.
45 replies
Missing required parameter for edit route redirect after creation error
Also opened an issue here: https://github.com/filamentphp/filament/issues/7592
45 replies
Missing required parameter for edit route redirect after creation error
For those who also want to reproduce the error locally I've made a simple public repo at: https://github.com/aflorea4/filament-missing-required-parameter-issue
Setup:
composer install
php artisan key:generate
php artisan migrate --seed
php artisan serve
Log in with:
localhost:8000/admin
[email protected]
password
Create a new EmploymentAnnouncement model from the admin panel.
45 replies
Missing required parameter for edit route redirect after creation error
Alright, thanks
1. php artisan make:filament-user
2. php artisan tinker
$user = User::first();
$user->assignRole('super_admin');
3. php artisan shield:generate --all
4. Head to /admin/employment-announcements/create
5. Create a new resource using some dummy data
45 replies
Missing required parameter for edit route redirect after creation error
In the AppServiceProvider boot() this is what I have:
/**
* Bootstrap any application services.
*/
public function boot(): void
{
Filament::serving(function () {
Filament::registerNavigationGroups([
NavigationGroup::make()
->label('Administration')
->icon('heroicon-s-library'),
NavigationGroup::make()
->label('Content')
->icon('heroicon-s-pencil'),
NavigationGroup::make()
->label('Settings')
->icon('heroicon-s-cog')
->collapsed(),
]);
});
\RyanChandler\FilamentNavigation\Filament\Resources\NavigationResource::navigationGroup('Administration');
MediaLibrary::registerMediaInfoInformationUsing(function (array $information, MediaLibraryItem $mediaLibraryItem, MediaItemMeta $mediaItemMeta): array {
return array_merge($information, [
'ID' => $mediaLibraryItem->getKey(),
'Thumb conversion generated' => $mediaLibraryItem->getItem()->hasGeneratedConversion('thumb') ? 'Yes' : 'No',
]);
});
MediaLibrary::registerMediaInfoFormFields(fn (array $schema): array => [
...$schema,
SpatieTagsInput::make('tags'),
]);
FilamentNavigation::addItemType('Page Link', [
Select::make('page_id')
->searchable()
->options(function () {
return Page::pluck('title', 'id');
})
]);
FilamentNavigation::addItemType('Document Link', [
Select::make('document_id')
->searchable()
->options(function () {
return Document::pluck('name', 'id');
})
]);
}
45 replies