public function hasPermission($permission)
    {
        return $this->roles->each(function ($role) use ($permission) {
            if (in_array($permission, explode(',', $role->permissions))) {
                return true;
            }
        });

        return false;
    }
public function hasPermission($permission)
    {
        return $this->roles->each(function ($role) use ($permission) {
            if (in_array($permission, explode(',', $role->permissions))) {
                return true;
            }
        });

        return false;
    }
public function hasPermission ( $ permission ) { return $ this -> roles -> each ( function ( $ role ) use ( $ permission ) { if ( in_array ( $ permission , explode ( ',' , $ role -> permissions ) ) ) { return true ; } } ) ; return false ; }
Check if user has permission

@param  string  $permission
@return boolean
Check if user has permission