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

User Model class must be implemented from "Itstructure\LaRbac\Interfaces\RbacUserInterface". #2

Open
Matleyx78 opened this issue Aug 2, 2022 · 5 comments

Comments

@Matleyx78
Copy link

Status:

New fresh laravel Installation (v9.22.1)
Setting .env database correctly.
run command:
composer require itstructure/laravel-rbac "~3.0.6"
php artisan rbac:publish
After this, i don'touch anything in config/rbac.php, because my User model is in the standard position (app\Models\User), but if i run php artisan rbac:database, return this error:
2020_07_11_151834_create_user_role_table ....................................................................... 1ms FAIL Failed! User Model class must be implemented from "Itstructure\LaRbac\Interfaces\RbacUserInterface".
All files are untouched from standard installation.

@Pream-webapps
Copy link

Hi I am also facing the same issue

@ThuretGbenougan
Copy link

me too

@guntutur
Copy link

guntutur commented Dec 5, 2022

you have to implement the said interface and its stub in your user class model, in my case it solve error to be thrown

@RosyStephen
Copy link

`
use Itstructure\LaRbac\Interfaces\RbacUserInterface;
use Itstructure\LaRbac\Traits\Administrable;

class User extends Authenticatable implements RbacUserInterface
{
use HasApiTokens, Administrable, HasFactory, Notifiable;
.......
`

Change user model like above it works for me.

@itstructure
Copy link
Owner

Yes, your User model must be implemented by Itstructure\LaRbac\Interfaces\RbacUserInterface interface and must contain its methods.
And use Itstructure\LaRbac\Traits\Administrable trait in a User model.

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

6 participants