Directing to a form in a resource from a widget in my dashboard
I got this widget in my dashboard:
and it has to direct to a:
public static function form(Form $form): Form
(inside a Resource)
How do I make this work?
15 Replies
if you run the php artisan route:list option you can see which routes are available for you
if you for example have a UserResource in a Admin panel.. the route would be filament.admin.resources.users.index for the index page or .create for the create page
then just use
in your href π
i have tried this, but there is no route to the actual form,
the best it has is a route to the resource it self:
the "new site" opens a modal?
yes that opens a form
and that is what i want to show
is there a create entry in your getPages function in the Resource?
there is not no
aaaah that's probably the issue then
so if i would create an create entry in the getpages it would show a route in the route:list right?
is it possible to not do that and actually go from the widget to the form
the "new site" opens a model simillair to this
is it possible to when i press my button in my widget to open it like this
I'm not completely sure... I think the modal is in the ListResource
yes I understand... don't think the modal is available on your dashboard page
maybe there is a "secret" link to go to the .index page and open the create modal?
alright
will keep on looking
or maybe some hopps in the chat
thank you tho
If i find something I'll paste it here π
basically, since there is no page or route, you will need to grab the resource, new it up and create a new action that can use the details from the resource to open the modal with the form. See here for how i'm doing it. https://github.com/awcodes/filament-quick-create/blob/3.x/src/Components/QuickCreateMenu.php
GitHub
filament-quick-create/src/Components/QuickCreateMenu.php at 3.x Β· a...
Plugin for Filament Panels that adds a dropdown menu to the header to quickly create new items. - awcodes/filament-quick-create
Wow that's next level π nice!!