app/Http/Traits/HasRoles.php
/**
     * Determine if the model has the given permission.
     *
     * @return bool
     */
Determine if the model has the given permission.
@return bool
Determine if the model has the given permission . @return bool
public function hasDirectPermission($permission): bool {
        if (is_string($permission)) {
            $permission = Permission::findByName($permission);
            if (!$permission) {
                return false;
            }
        }
        return $this->can($permission);
    }
public function hasDirectPermission ( $ permission ) : bool { if ( is_string ( $ permission ) ) { $ permission = Permission :: findByName ( $ permission ) ; if ( ! $ permission ) { return false ; } } return $ this -> can ( $ permission ) ; }
Determine if the model has the given permission.
Determine if the model has the given permission .