app/Http/Traits/HasRoles.php
/**
     * Determine if the model may perform the given permission.
     * @param $permission
     * @return bool
     */
Determine if the model may perform the given permission.
@param $permission
@return bool
Determine if the model may perform the given permission . @param $permission @return bool
public function hasPermissionTo($permission): bool {
        if (is_string($permission)) {
            $permission = Permission::findByName($permission);
        }
        return $this->hasDirectPermission($permission) || $this->hasPermissionViaRole($permission);
    }
public function hasPermissionTo ( $ permission ) : bool { if ( is_string ( $ permission ) ) { $ permission = Permission :: findByName ( $ permission ) ; } return $ this -> hasDirectPermission ( $ permission ) || $ this -> hasPermissionViaRole ( $ permission ) ; }
Determine if the model may perform the given permission.
Determine if the model may perform the given permission .