F
Filament12mo ago
Rahaf

CreateAction::make()

I try to make Filament Nested Resources this is my code i use it in v2 the problem is the create action does not work i use create action ->url and in v3 ->successRedirectUrl Are they different or the same?
public static function getPages(): array
{
return [
'index' => Pages\ListLevelGames::route('/'),
'level-games' => Pages\ListLevelGames::route('/{record}'),
'create' => Pages\CreateLevelGame::route('/{record}/create'),
'edit' => Pages\EditLevelGame::route('/{record}/edit'),
];
}
public static function getPages(): array
{
return [
'index' => Pages\ListLevelGames::route('/'),
'level-games' => Pages\ListLevelGames::route('/{record}'),
'create' => Pages\CreateLevelGame::route('/{record}/create'),
'edit' => Pages\EditLevelGame::route('/{record}/edit'),
];
}
protected function getHeaderActions(): array
{
return [
Actions\CreateAction::make()
->url(fn (): string => LevelGameResource::getUrl('create', ['record' => request('record')])),


];
}
protected function getHeaderActions(): array
{
return [
Actions\CreateAction::make()
->url(fn (): string => LevelGameResource::getUrl('create', ['record' => request('record')])),


];
}
here CreateAction on v3 documents

CreateAction::make()
->successRedirectUrl(fn (Model $record): string => route('posts.edit', [
'post' => $record,
])
here CreateAction on v3 documents

CreateAction::make()
->successRedirectUrl(fn (Model $record): string => route('posts.edit', [
'post' => $record,
])
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server