For a custom filament page to edit a specific eloquent model, what is the URL of that page?
I haven't found any explanation how to find out the URL of a custom edit page of an Eloquent model.
Is the URL based on the namespace and class name and panel?
this is what I got, but I haven't been able to figure out how to view my page by using the URL. The id of the resource I want to test is 2.
How do I find out the URL?
6 Replies
well, I have found out:
But the page does not expect /{record}/ . How do I enable the edit page?
Is this page part of a resource?
I don't know what went wrong during the development phase, that I have tried to install a new fresh Laravel app with filament. As you suggest, I have added that page into the resource
getPages()
method:
and now I can see it registered inside the laravel routes:
/.../projects/{record}/fechas-confirmar
Then, how do I get the {record}
in the custom page to fill the values in the form, so that the user can edit that record?You need to define the
$slug
property
Then, how do I get the {record} in the custom page to fill the values in the form, so that the user can edit that record?This part
public function mount(Proyecto $proyecto):
should be public function mount(Proyecto $record)
: because the route has {record}
.Thanks. Looks like I can get it from the route name list. The protected
$slug
property inside the custom page doesn't take effect but it does right from the getPages()
array of the Resource.The protected $slug property inside the custom page doesn't take effectYes, it's used for pages. But since you register it via the resource it isn't I thought it's a non-resource page