Support the ongoing development of Laravel.io →
Views Blade Eloquent
Last updated 2 years ago.
0

Can you post your getRoles() function?

Last updated 2 years ago.
0

Sure. It's actually from a DB repository which extends an interface. Can't figure it out. BTW... I am using the package Entrust.


public function getRoles($users)
    {

       foreach($users as $user){
           $roles[] = \User::with('roles')->find($user->id);
       }

        return $roles;
    }
Last updated 2 years ago.
0

I don't see what's the problem. You can still use the parameters like:

$role->id

And so on..

Last updated 2 years ago.
0

I'm trying to get the roles for the user based on the user id. Not a role name based on $role->id

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

muzikman muzikman Joined 6 Oct 2014

Moderators

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

Your logo here?

Laravel.io

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

© 2024 Laravel.io - All rights reserved.