TappNetwork / filament-authentication-log

31 stars 14 forks source link

Route [filament.admin.resources.users.edit] not defined. #10

Open gosheto opened 9 months ago

gosheto commented 9 months ago

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>');

swilla commented 9 months ago

Can you send the versions of the following:

gosheto commented 9 months ago
gosheto commented 9 months ago

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.

rmirandadev commented 9 months ago

Any solution? I have the same problem? Route [filament.admin.resources.users.edit] not defined.

gosheto commented 9 months ago

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(),
    ];
}

}`

akunbeben commented 8 months ago

https://github.com/TappNetwork/filament-authentication-log/blob/438717211f811c5c4aa51b0971b04604c09434d1/src/Resources/AuthenticationLogResource.php#L83

IMO, this line isn't necessary. I don't have the [filament.{panel}.resources.users.edit] route, others too.

bamod33 commented 5 months ago

Same problem here:

Route [filament.admin.resources.admins.edit] not defined.

In both, in Authentication Logs section and relation manager.

abbasmashaddy72 commented 4 months ago

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?

valpuia604 commented 2 months ago

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

xalabama commented 2 months ago

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.