F
Filament9mo ago
Pan

Moving specific Resource for a different panel

In my Admin Panel there is a resource called UserResource, and I want to move this to the resource path for my moderator panel, however I get an error, see attached images. I have tried the 'composer dump-autoload' & 'php artisan optimze:clear'
No description
No description
No description
No description
Solution:
You need to adjust any use statements in all your classes too.
Jump to solution
5 Replies
Pan
Pan9mo ago
I tried the other posted recently https://discord.com/channels/883083792112300104/1169729866430689443 Where it said to just move the files and update the namespaces but now I get this error which is at the vendors folder I tried to error the same commands 'composer dump-autoload', 'php artisan optimize:clear' and 'php artisan cache:clear'
No description
Solution
awcodes
awcodes9mo ago
You need to adjust any use statements in all your classes too.
toeknee
toeknee9mo ago
This is why I love phpStorm
awcodes
awcodes9mo ago
Same
Pan
Pan9mo ago
Damn, Thank you, I found the mistake, I thought the use Filament\Resources\Pages\CreateRecord; use Filament\Resources\Pages\EditRecord; use Filament\Resources\Pages\ListRecords; Should also be adjusted to use Filament\Moderator\Resources\Pages\CreateRecord; use Filament\Moderator\Resources\Pages\EditRecord; use Filament\Moderator\Resources\Pages\ListRecords; Thank you, I thought I'd give up and start from scratch!