Create resource not found

Hello everyone, I have a small problem with one of my resources (CustomerResource). Originally, I had removed the creation page to keep only the modal because the form was quite simple. It got more complex later, but I can't find the creation page. Every time I get a 404... - I do have a page resources/CustomerResource/CreateCustomer.php - The page is correctly listed in getPages() - My route is present in php artisan route:list and the URL is correct - I've cleared the routes and application cache Am I missing something?
public static function getPages(): array
{
return [
'index' => Pages\ListCustomers::route('/'),
'view' => Pages\ViewCustomer::route('/{record}'),
'create' => Pages\CreateCustomer::route('/create'),
'edit' => Pages\EditCustomer::route('/{record}/edit'),
];
}
public static function getPages(): array
{
return [
'index' => Pages\ListCustomers::route('/'),
'view' => Pages\ViewCustomer::route('/{record}'),
'create' => Pages\CreateCustomer::route('/create'),
'edit' => Pages\EditCustomer::route('/{record}/edit'),
];
}
namespace App\Filament\Resources\CustomerResource\Pages;

use App\Filament\Resources\CustomerResource;
use Filament\Resources\Pages\CreateRecord;
use Illuminate\Contracts\Support\Htmlable;

class CreateCustomer extends CreateRecord
{
protected static string $resource = CustomerResource::class;

public function getTitle(): string|Htmlable
{
return 'Créer un nouveau client';
}
}
namespace App\Filament\Resources\CustomerResource\Pages;

use App\Filament\Resources\CustomerResource;
use Filament\Resources\Pages\CreateRecord;
use Illuminate\Contracts\Support\Htmlable;

class CreateCustomer extends CreateRecord
{
protected static string $resource = CustomerResource::class;

public function getTitle(): string|Htmlable
{
return 'Créer un nouveau client';
}
}
https://i.postimg.cc/GLGyPd4K/route-list.jpg https://i.postimg.cc/Hxgjv8r2/404.jpg I've compared it with my other resources and it all looks good... I only have the problem with this resource. Thanks 🙂
No description
Solution:
You put the create route below the view route so it tries to look for a record with the slug create.
Jump to solution
2 Replies
Solution
Dennis Koch
Dennis Koch3mo ago
You put the create route below the view route so it tries to look for a record with the slug create.
Alexandre
Alexandre3mo ago
🤦‍♂️🤦‍♂️🤦‍♂️🤦‍♂️🤦‍♂️🤦‍♂️🤦‍♂️ Thanks, that was it and it works. Sorry and thanks again 😅
Want results from more Discord servers?
Add your server