F
Filament15mo ago
sotjj

Artisan commands will not run after adding in a PanelProvider

Whether I upgrade to v3 manually or automatically, adding either or both of the following: App\Providers\Filament\AppPanelProvider::class, App\Providers\Filament\AdminPanelProvider::class, to config/app.php causes php artisan commands to fail and no pages will load. If neither are present in config/app.php, artisan commands will run and pages without filament elements/resources will load.
1 Reply
sotjj
sotjjOP15mo ago
I think I have narrowed it down to the discoverResources, discoverPages, and discoverWidgets methods. I am guessing there is a problem with my path after the upgrade (update: not a path issue, see below for updates). I will post the solution if I figure it out. So, it turns out that there are just issues in various resources, widgets, and pages that are causing these methods to fail.
I commented out the discover methods and I am going through the process of loading them one-by-one to see which ones are causing problems. So far, the issue in most of my resources was the following: protected function getDefaultTableRecordsPerPageSelectOption(): int { return 20; } When loading this manually, I received a detailed error message instead of the earlier 500 error: getDefaultTableRecordsPerPageSelectOption() must be public (as in class Filament\Resources\Pages\ListRecords) Setting this to public allowed the resource to load. So, now I am just going through and loading resources, pages and widgets manually (without the discover method) to solve the issues for each one.
Want results from more Discord servers?
Add your server