I get Class "App\Filament\Pages\Dashboard" not found after removing Dashboard on Production
I wanted to create a custom dashboard instead of the default panel dashboard. I named my custom dashboard class something other than
Dashboard
, which I had no issues with when developing locally. Then when pushing my changes to Production (Staging environment), I get the Class "App\Filament\Pages\Dashboard" not found
error.
Has anyone else experienced something similar? It is very strange that I get the error on production but not locally.18 Replies
did you set it on the panel provider
->pages()
also looks like file came case sensitive between linux and windows or mac!No I removed everything from ->pages([]) on the panel provider.
I think filament need a default page to land on it 🙂
try add the new dashboard you made in
->pages()
Thanks! I will try that next time I push to production. But strange that filament doesn't need this on my local environment.
it could be cached on local?
I just tried to add to add my new dashboard to ->pages() like this:
And I still get the error:
Class "App\Filament\Pages\Dashboard" not found
But I just don't understand where filament gets App\Filament\Pages\Dashboard
from, as I don't have that in my code anywhere 🤔
Here is a shared flare of my error, it seems to have something to do with routes:
https://flareapp.io/share/LPd0G9dPFlare
Class "App\Filament\Pages\Dashboard" not found - The error occurred at https://appstaging.meinrad.ch/admin/kitchen
I do have this route in my
routes/web.php
file:
Which I use for my inertia frontend. Maybe this has something to do with it?Did you extend filaments dashboard class in KitchenDashboard? Sounds like a missing use statement.
I did this:
this should probably just be
HasFiltersForm
I removed KitchenDashboard from my admin panel provider pages as this wasn't necessary on a fresh filament installation, and changed to:
I get the same ish error still:
Here is my flare error:
https://flareapp.io/share/bP9oYg85
Flare
include(/home/www/appstaging.meinrad.ch/app/Filament/Pages/Dashboard.php): Failed to open stream: No such file or directory - The error occurred at https://appstaging.meinrad.ch/admin
Still weird that I have no issues on my local environment, only on my remote server do I get this error.
Maybe a permissions issue on the server.
Definitely something odd going on with the namespaces.
One thing to try would be to delete vendor and composer install.
Could it be a cached binding in the bootstrap/cache directory?
Yes! I found this:
in
/bootstrap/cache/filament/panels/admin.php
What is the recommended way of clearing this cache?Should this be ran on every deploy?
I had to use this as well I think:
Are you saying this wasn't necessary?
i didn't say its necessary or not
everyone has different use case use what you need and what works for you
yes
i recommend you read more about these commands and what they do