Files
laravel-manager-packagist/src/Modules/Posts/PostsModule.php
T

42 lines
1.1 KiB
PHP

<?php
namespace IriksIT\Manager\Modules\Posts;
use IriksIT\Manager\Modules\BaseModule;
use IriksIT\Manager\Support\Permission;
class PostsModule extends BaseModule
{
public function key(): string
{
return 'posts';
}
public function label(): string
{
return 'Posts';
}
public function enabledByDefault(): bool
{
return false;
}
public function permissions(): array
{
return [
new Permission('posts.view', 'See the posts, drafts included', 'Posts'),
new Permission('posts.write', 'Write posts: create drafts and change them', 'Posts', needs: ['posts.view']),
new Permission('posts.publish', 'Publish, schedule and unpublish posts, and change posts that are live', 'Posts', needs: ['posts.view', 'posts.write']),
new Permission('posts.delete', 'Delete posts', 'Posts', needs: ['posts.view']),
];
}
public function navigation(): array
{
return [
['label' => 'Posts', 'route' => 'manager.posts.index', 'permission' => 'posts.view'],
];
}
}