Open gosheto opened 9 months ago
Can you send the versions of the following:
After setup Customizing the authentication features all work and routes are defined, but in clean Filament install get error Route [filament.admin.resources.users.edit] not defined.
Any solution? I have the same problem? Route [filament.admin.resources.users.edit] not defined.
Enable authentication features for a panel in the configuration file. Follow : Authorizing access to the panel After this create :
app/Fillament/Resources/UserResource/Auth/Pages/CreateUser.php
`<?php
namespace App\Filament\Resources\UserResource\Pages;
use App\Filament\Resources\UserResource; use Filament\Actions; use Filament\Resources\Pages\CreateRecord;
class CreateUser extends CreateRecord { protected static string $resource = UserResource::class; }`
app/Fillament/Resources/UserResource/Auth/Pages/EditUser.php
`<?php
namespace App\Filament\Resources\UserResource\Pages;
use App\Filament\Resources\UserResource; use Filament\Actions; use Filament\Resources\Pages\EditRecord;
class EditUser extends EditRecord { protected static string $resource = UserResource::class;
protected function getHeaderActions(): array
{
return [
Actions\DeleteAction::make(),
];
}
}`
IMO, this line isn't necessary. I don't have the [filament.{panel}.resources.users.edit] route, others too.
Same problem here:
Route [filament.admin.resources.admins.edit] not defined.
In both, in Authentication Logs section and relation manager.
You Need to have Admin Resources Created @bamod33 User Resources Created @gosheto
artisan route:list
GET|HEAD admin/users .................................................... filament.admin.resources.users.index › App\Filament\Admin\Resources\UserResource\Pages\ListUsers
GET|HEAD admin/users/create ........................................... filament.admin.resources.users.create › App\Filament\Admin\Resources\UserResource\Pages\CreateUser
GET|HEAD admin/users/{record} ............................................. filament.admin.resources.users.view › App\Filament\Admin\Resources\UserResource\Pages\ViewUser
GET|HEAD admin/users/{record}/edit ........................................ filament.admin.resources.users.edit › App\Filament\Admin\Resources\UserResource\Pages\EditUser
if you are still facing the same issue, send the route:list
Just to make sure, are you using multiple panels?
If you user --simple
flag while generating UserResource then this problem come, you have to generate without --simple
flag to make this work for now
There is an configuration inside the filament-authentication-log.php
:
'resources' => [
'AutenticationLogResource' => \Tapp\FilamentAuthenticationLog\Resources\AuthenticationLogResource::class,
],
You can create a custom resource that extends that resource, copy the table method from there and modify the line that was commented from @akunbeben by change the route or remove the anchor. After this you can change the configuration to your custom AuthenticationLogResource.
This will solve your problems for now. Further i think it will be a good idea to add some configuration for this behavior.
After click on admin panel link authentication-logs get:
Symfony \Component \Routing \Exception\RouteNotFoundException Route [filament.admin.resources.users.edit] not defined.
$response = $kernel->handle( $request = Request::capture() )->send();
Tapp\FilamentAuthenticationLog\Resources\AuthenticationLogResource: 83 Tapp\FilamentAuthenticationLog\Resources{closure}
Tapp\FilamentAuthenticationLog\Resources\AuthenticationLogResource 83 line:
return new HtmlString('<a href="'.route('filament.'.Filament::getCurrentPanel()->getId().'.resources.'.Str::plural((Str::lower(class_basename($record->authenticatable::class)))).'.edit', ['record' => $record->authenticatable_id]).'" class="inline-flex items-center justify-center hover:underline focus:outline-none focus:underline filament-tables-link text-primary-600 hover:text-primary-500 text-sm font-medium filament-tables-link-action">'.class_basename($record->authenticatable::class).'</a>');