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
Patrick1989
Patrick19897mo ago
you used the command line to make them?
RustyTrombone
RustyTrombone7mo ago
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"
Patrick1989
Patrick19897mo ago
and they are in that folder? because when u use the command line its going into filament/resources instead of admin/resources right
RustyTrombone
RustyTrombone7mo ago
It asks
RustyTrombone
RustyTrombone7mo ago
No description
Patrick1989
Patrick19897mo ago
mm what is the namespace now in that resource file
RustyTrombone
RustyTrombone7mo ago
It was namespace App\Filament\Resources; Which I just changed to namespace App\Filament\Admin\Resources; But still nothing
Patrick1989
Patrick19897mo ago
mm not sure but can u try` ->discoverResources(in: app_path('Filament/Admin/Resources'), for: 'App\Filament\Admin\Resources')
RustyTrombone
RustyTrombone7mo ago
Class "App\Filament\Resources\LocationsResource" not found
Patrick1989
Patrick19897mo ago
does it work when you keep the default namespace? without admin and default folder structure
RustyTrombone
RustyTrombone7mo ago
Lemme try It does indeed
Patrick1989
Patrick19897mo ago
yea not sure where the exact issue lies probably in the customization somewhere ye
RustyTrombone
RustyTrombone7mo ago
Hmmm, I haven't changed anything else - literally just installed it and wanted to add seperate Directories for "Admin" and "Customer" resources
Patrick1989
Patrick19897mo ago
hehe i'd just add it into resources if thats possible, so like Filament/Resource/Admin/YourResource never tried to customize it tbh
RustyTrombone
RustyTrombone7mo ago
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
No description
Patrick1989
Patrick19897mo ago
mm have to dive into the core there, but my assumption is that it just scans for 1 folder
RustyTrombone
RustyTrombone7mo ago
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
Patrick1989
Patrick19897mo ago
yea that could be not a strange thought at all
DarkKnight
DarkKnight7mo ago
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')
DrByte
DrByte7mo ago
->discoverResources(in: app_path('Filament/Admin/Resources'), for: 'App\\Filament\\Admin\\Resources')
->discoverPages(in: app_path('Filament/Admin/Pages'), for: 'App\\Filament\\Admin\\Pages')
->discoverResources(in: app_path('Filament/Admin/Resources'), for: 'App\\Filament\\Admin\\Resources')
->discoverPages(in: app_path('Filament/Admin/Pages'), for: 'App\\Filament\\Admin\\Pages')
->discoverResources(in: app_path('Filament/Customer/Resources'), for: 'App\\Filament\\Customer\\Resources')
->discoverPages(in: app_path('Filament/Customer/Pages'), for: 'App\\Filament\\Customer\\Pages')
->discoverResources(in: app_path('Filament/Customer/Resources'), for: 'App\\Filament\\Customer\\Resources')
->discoverPages(in: app_path('Filament/Customer/Pages'), for: 'App\\Filament\\Customer\\Pages')