Custom page
After creating data using reource need to redirect to a custom page with created record id, how to get that id through route..
in getgaes of resource i added like this
public static function getPages(): array
{
return [
'details' => Pages\VehicleDetails::route('/details'),
];
}
,
in createpage i added
protected function getRedirectUrl(): string
{
return $this->getResource()::getUrl('details');
}
2 Replies
-
VehicleDetails
needs to have a public $record
property.
- The route needs to have a placeholder: 'details' => Pages\VehicleDetails::route('/details/{record}'),
- I think you can access $this->record
for the URL: $this->getResource()::getUrl('details', ['record' => $this->record]);
okay, Thank you.