mirror of
https://github.com/filamentphp/filament.git
synced 2026-09-24 15:42:09 +08:00
Merge pull request #624 from bradyrenting/docs
Document resource page redirects
This commit is contained in:
@@ -191,6 +191,19 @@ For further customization opportunities, you can override the static `$view` pro
|
||||
public static $view = 'customers.list-records';
|
||||
```
|
||||
|
||||
#### Customizing Form Redirects
|
||||
|
||||
You may specify a custom redirect URL for the Create and Edit pages by overriding the `getRedirectUrl()` method.
|
||||
|
||||
For example, the Create form can redirect back to the List page when it is submitted:
|
||||
|
||||
```php
|
||||
protected function getRedirectUrl(Model $record): string
|
||||
{
|
||||
return $this->getResource()::generateUrl('index');
|
||||
}
|
||||
```
|
||||
|
||||
#### Hooks
|
||||
|
||||
Hooks may be used to customize the behaviour of a default page. To set up a hook, create a protected method on the page class with the name of the hook:
|
||||
|
||||
Reference in New Issue
Block a user