Closed mohammedBamatraf closed 1 year ago
Note to: @rabol , @curder , @onexer
@rabol , @curder , @onexer , any Update
Not really sure how to fix this as you can see the code is registreing the policy that is in the config:
i found the problem thank you
I downloaded the log viewer library in Laravel and followed the installation instructions. However, I'm encountering an error when trying to use my custom policy. The error message states: "Rabol\FilamentLogviewer\Policies\LogFilePolicy::delete(): Argument #1 ($user) must be of type App\Models\User, App\Models\Admin given, called in C:\github\backend-rakeb\vendor\laravel\framework\src\Illuminate\Auth\Access\Gate.php on ...".
Steps to Reproduce:
config/filament-logviewer.php
.policy_class
key is set to the correct namespace and class name of your custom policy, which isApp\Policies\LogFilePolicy::class
.Expected Behavior: I expected the log viewer library to use my custom policy,
App\Policies\LogFilePolicy
, for authorization checks.Actual Behavior: Instead of using my custom policy, the log viewer library is trying to use
Rabol\FilamentLogviewer\Policies\LogFilePolicy
and encountering a type error when calling thedelete
method.Custom Policy Contents: