- Add the package to your project.
composer require webbundels/documentation
- Migrate the database.
php artisan migrate
- Add the method 'getDocumentationViewableAttribute' to your user model.
- Write logic in this method that determines if the user can view the documentation page.
public function getDocumentationViewableAttribute() :bool
{
return $this->can('view_documentation');
}
- Add the method 'getDocumentationEditableAttribute' to your user model.
- Write logic in this method that determines if the user can edit the documentation page.
public function getDocumentationEditableAttribute() :bool
{
return $this->can('edit_documentation');
}