Support the ongoing development of →
Authentication Database Eloquent
Last updated 2 years ago.

Fixed! I added a foreach loop on $ user-> roles () and then called the "name" field inside the foreach.

Last updated 2 years ago.

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?

Last updated 2 years ago.

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.

Last updated 2 years ago.

Sign in to participate in this thread!


Your banner here too?

phroccon phroccon Joined 25 Jul 2014


We'd like to thank these amazing companies for supporting us

Your logo here?

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 - All rights reserved.