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
Vp
Vp15mo ago
Did you use cache? try php artisan optimize:clear
Albert Lens
Albert LensOP15mo ago
Same result!!!😩
Vp
Vp15mo ago
You also remove create page inside resource/pages right? let me try to reproduce
Albert Lens
Albert LensOP15mo ago
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.
Vp
Vp15mo ago
I've tried make:filament-resource Record but I didn't get any error tho
*
*15mo ago
You need to alias your imports if you want to use CreateRecord etc...
use Namespace\CreateRecord as MyCreateRecord
use Namespace\CreateRecord as MyCreateRecord
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 Filament
Albert Lens
Albert LensOP15mo ago
But 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.
Want results from more Discord servers?
Add your server