saqueib
288
3
Spark

I want to use laravel permission with spark

Posted 1 year ago by saqueib

I want to use laravel permissions, I can assign role on the register

Spark::createUsersWith(function ($request) {
    ...
    $user->assignRole('owner');
});

but how can I get the current role associated with a logged in user in front-end, and also I need to list all the roles available from roles table?

When I check in dev console user variable there is no roles property. and global spark.roles is also an empty array.

Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.