How to DELETE resource completely and correctly???. Having trouble
Hello.
I created a resource called Record, and decided to go back. Deleted the folder in app\Filament\Resources\RecordResource and also the file app\Filament\Resources\RecordResource.php.
When I make the resource again, it keeps giving errors, I cannot use the application.
It says:
Symfony\Component\ErrorHandler\Error\FatalError
Cannot declare class App\Filament\Resources\RecordResource\Pages\CreateRecord because the name is already in use
Any idea of how to COMPLETELY delete a resource?
Please help.
7 Replies
Did you use cache? try
php artisan optimize:clear
Same result!!!😩
You also remove create page inside resource/pages right?
let me try to reproduce
I think I found what it is and has no solution.
If I want a resource called Record it will have to have the methods CreateRecord, etc. And that is reserved. All resources have this at the beginning of the CreateWhateverResourceNamephp:
class CreateNotary extends CreateRecord
So it is A RESERVED name. Record must not be used, I understand, as a resource name. I'll change it
Tks a lot, anyway.
Problem is the name of the resource I chose.
I've tried
make:filament-resource Record
but I didn't get any error thoYou need to alias your imports if you want to use
CreateRecord
etc...
But, I'm not sure if it's a good idea, too much cognitive overhead
I'd rather rename my resource to something that is not reserved by FilamentBut when you open the RecordResource.php file you will find the errors.
Thank you anyhow.
I have changed the name of the resource and table to DossierResouce and table dossiers and I will translate the names for my customer.
And then it is solved.
Thank you all for your kind help.