Resource not appearing in Menu
I have created too "Panels", "Customer" and "Admin".
In my "Admin" Panel, I'm trying to create a resource and show it in the menu - I thought this happened automatically but I think I'm doing something wrong. I've created a resource based off of my model, but it doesn't appear in the Admin Menu. All I have is "Dashboard".
Going to /admin/myresource - 404's. This is a fresh install
20 Replies
you used the command line to make them?
Yessir.
I did change the default "discoverResources" in the admin oanel to this:
->discoverResources(in: app_path('Filament/Admin/Resources'), for: 'App\Filament\Resources')
Added "/Admin"
and they are in that folder?
because when u use the command line its going into filament/resources instead of admin/resources right
It asks
mm
what is the namespace now in that resource file
It was
namespace App\Filament\Resources;
Which I just changed to
namespace App\Filament\Admin\Resources;
But still nothing
mm
not sure but can u try`
->discoverResources(in: app_path('Filament/Admin/Resources'), for: 'App\Filament\Admin\Resources')
Class "App\Filament\Resources\LocationsResource" not found
does it work when you keep the default namespace?
without admin
and default folder structure
Lemme try
It does indeed
yea not sure where the exact issue lies
probably in the customization somewhere ye
Hmmm, I haven't changed anything else - literally just installed it and wanted to add seperate Directories for "Admin" and "Customer" resources
hehe
i'd just add it into resources
if thats possible, so like Filament/Resource/Admin/YourResource
never tried to customize it tbh
Seems weird that "Customer" works but Admin doesn't - guess it's just one of those things and I'll have to shake violently every time I see it
mm have to dive into the core there, but my assumption is that it just scans for 1 folder
You can have multiple panels though? So I could create a new panel called "Dragons" and then my localhost/dragons/login would work
And presumably, the navigation there would work too
Maybe it's just like "Admin" is reserved?
I dunno
yea that could be
not a strange thought at all
I think the reason is this. Filament might be looking for Resources in just
Filament/Resource/
. Please go to the admin panel and change the array to:
->discoverResources(in: app_path('Filament/Resources/Admin'), for: 'App\\Filament\\Resources\\Admin')