Upgrade to Filament v3
Hello, guys. I've made the upgrade to Filament v3 but I have this error. How can I solve it?
32 Replies
What PHP Version are you using?
8.1.23
and Laravel 10.23.0
are you sure php cli is 8.1?
run: php artisan about
I ran this command before upgrading the filament. Now if I run it, I get the above error
this is the version from composer for filament "filament/filament": "^3.0-stable",
Any idea?
delete your vendor folder then run composer install
same error
I commented this line // App\Providers\Filament\AdminPanelProvider::class,
in app.config. The error disappeard, but the admin have 404 error now
Check the config
filament.config or app.config?
this is the app config
I think the error is related to this path " ->discoverResources(in: app_path('Filament/Resources'), for: 'App\Filament\Resources')
->discoverPages(in: app_path('Filament/Pages'), for: 'App\Filament\Pages')" When I delete or change, the error disappears.
Any idea, please? 😄
When I delete or change, the error disappearsWhat did you change exactly? Can you show an example that works and an example that doesn't?
if I put the path like this I don't have any errors but I only see the dashboard, not the resources. And when I put the path like this I have this error "Only arrays and Traversables can be unpacked"
and this is the structure
Makes sense, I think the first one is giving paths like
/my/project/app/app/Filament/Resources
(double app
), that don't exist
I have this error "Only arrays and Traversables can be unpacked"Can you click SHARE at the top of the error page, and share the URL here? Oh, this is in the console... can you get to this error in the Browser?
Flare
Only arrays and Traversables can be unpacked - The error occurred at https://st-martin-api.graffino.dev/admin
Does this happen after login? Like it's trying to show the Dashboard page?
Yes
Can you get any other page to load by visiting the direct URL? like
/admin/posts
I have the same error
Maybe is something wrong with the folder structure?
I think it looks fine, in your screenshot 👆
If you open the site in an incognito tab, can you access the login form?
php artisan about
-> which Filament version?This is very weird 😔
Can you share your
composer.json
?Running out of ideas, hehe
Can you do a search in your codebase for
$routeMiddleware
. Is there anything that modifies this variable on your pages?I don't have this in Kernel
and also I have this in a resource protected static string|array $routeMiddleware = 'base';
It's fine in Kernel, I'm thinking about your Filament code specifically.
This could be it, can you try
$routeMiddleware = ['base']
;I found the problem....
I deleted this line and it works...protected static string|array $routeMiddleware = 'base';
and it's also working with your code 🙏🏻
Thank you so much!
You're welcome 🙌