bezhanSalleh / filament-shield

The easiest and most intuitive way to add access management to your Filament Admin Resources, Pages & Widgets through `spatie/laravel-permission`
MIT License
1.35k stars 166 forks source link

Error with implements FilamentUser and HasPanelShield #400

Open gjimenez-gc opened 3 weeks ago

gjimenez-gc commented 3 weeks ago

Hi,

Been trying to setup a HasPanelShield implements FilamentUser to my User resource but every time I delete the db and try to run the migration from start I'm getting this error:

SQLSTATE[HY000] [1049] Unknown database 'laravelfilament02' (Connection: mysql, SQL: select * fromroleswhere (name= panel_user) limit 1)

So when the db does not exists and I'm using implements FilamentUser its trying to get the roles, thus making the build fail, I'm missing something?

image

nnnnnnnngu commented 3 weeks ago

set panel user enabled to false

'panel_user' => [
        'enabled' => false,
        'name' => 'panel_user',
    ],

in config/filament-shield.php

run migration, run shield:install and enable panel_user after that.