Fixed! I added a foreach loop on $ user-> roles () and then called the "name" field inside the foreach.
I have a query regarding Confide with Entrust.
My user controller looks something like
use Zizaco\Confide\ConfideUser;
use Zizaco\Confide\ConfideUserInterface;
use Zizaco\Entrust\HasRole;
class User extends Eloquent implements ConfideUserInterface
{
use ConfideUser;
use HasRole;
}
But when I call Confide::user() it doesn't give me roles.
means when I try to call
Confide::user()->hasRole('Author') it is not working for me. Do you have any idea how can I use this?
I don't have an answer for this as I am looking for a guide to use entrust myself. But I think this is your model not the controller, right?
By the way, I am very new to laravel and not very sure what is an ideal way to create roles, assign them etc. I mean where should I create role. Should I just create it once, or what should be the workflow for that. If there is any guide to that, I would be happy to explore.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community