public function findByRoleID($id)
    {
        $usersWithRepo = [];
        $users = $this->model->all();

        foreach ($users as $user) {
            if ($user->roles->first()->id == $id) {
                $usersWithRepo[] = $user;
            }
        }

        return $usersWithRepo;
    }
public function findByRoleID($id)
    {
        $usersWithRepo = [];
        $users = $this->model->all();

        foreach ($users as $user) {
            if ($user->roles->first()->id == $id) {
                $usersWithRepo[] = $user;
            }
        }

        return $usersWithRepo;
    }
public function findByRoleID ( $ id ) { $ usersWithRepo = [ ] ; $ users = $ this -> model -> all ( ) ; foreach ( $ users as $ user ) { if ( $ user -> roles -> first ( ) -> id == $ id ) { $ usersWithRepo [ ] = $ user ; } } return $ usersWithRepo ; }
Find by Role ID
@param  integer $id
@return Collection
Find by Role ID