Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

It generates policies without using guard #62

Closed
cobraprojects opened this issue Jul 18, 2022 · 1 comment
Closed

It generates policies without using guard #62

cobraprojects opened this issue Jul 18, 2022 · 1 comment

Comments

@cobraprojects
Copy link

cobraprojects commented Jul 18, 2022

I have two guards web for frontend for User model and admin guard for filament for Admin model.

So in filament.php config file I have:

'auth'   => [
        'guard' => env('FILAMENT_AUTH_GUARD',  'admin'),
        'pages' => [
            'login' => \Filament\Http\Livewire\Auth\Login::class,
        ],
    ],

when I use php artisan shield:install or generate from the admin panel it generates the policies for the default gaurd not for the filament guard

@bezhanSalleh
Copy link
Owner

it's not the guard actually, it's the default User model.
Which has been hardcoded in the DefaultPolicy stub.
It's on my todo list to make it configurable via settings page, but haven't gotten to it yet.
So either make a PR or wait another week or so.

And to Solve your current Problem you would need to update the DefaultPolicy to use App\Models\Admin then run the shield:generate command.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants