webbundels/文档

1.4.0 2022-05-10 14:47 UTC

This package is not auto-updated.

Last update: 2024-09-25 01:51:17 UTC


README

安装

  1. 将包添加到您的项目中。
composer require webbundels/documentation
  1. 迁移数据库。
php artisan migrate

查看权限

  1. 将方法 'getDocumentationViewableAttribute' 添加到您的用户模型中。
  2. 在此方法中编写逻辑,以确定用户是否可以查看文档页面。
public function getDocumentationViewableAttribute() :bool
{
    return $this->can('view_documentation');
}

编辑权限

  1. 将方法 'getDocumentationEditableAttribute' 添加到您的用户模型中。
  2. 在此方法中编写逻辑,以确定用户是否可以编辑文档页面。
public function getDocumentationEditableAttribute() :bool
{
    return $this->can('edit_documentation');
}