public function can($name)
    {
        foreach ($this->roles as $role) {
            foreach ($role->permissions as $permission) {
                if ($permission->name == $name || $permission->slug == $name || $permission->id == $name) {
                    return true;
                }
            }
        }

        return false;
    }
public function can($name)
    {
        foreach ($this->roles as $role) {
            foreach ($role->permissions as $permission) {
                if ($permission->name == $name || $permission->slug == $name || $permission->id == $name) {
                    return true;
                }
            }
        }

        return false;
    }
public function can ( $ name ) { foreach ( $ this -> roles as $ role ) { foreach ( $ role -> permissions as $ permission ) { if ( $ permission -> name == $ name || $ permission -> slug == $ name || $ permission -> id == $ name ) { return true ; } } } return false ; }
Determine whether the user can do specific permission that given by name parameter.

@param $name

@return bool
Determine whether the user can do specific permission that given by name parameter .