feat: new feature

This commit is contained in:
JaguarJack
2022-12-23 19:47:13 +08:00
parent 17f2dc4d3c
commit 81fac9f62c
38 changed files with 1019 additions and 1486 deletions

View File

@@ -5,24 +5,17 @@ namespace Modules\Permissions\Providers;
use Catch\CatchAdmin;
use Catch\Providers\CatchModuleServiceProvider;
use Modules\Permissions\Middlewares\PermissionGate;
use Modules\Permissions\Models\LogOperate;
class PermissionsServiceProvider extends CatchModuleServiceProvider
{
/**
* register permission gate
* middlewares
*
* @throws \Psr\Container\ContainerExceptionInterface
* @throws \Psr\Container\NotFoundExceptionInterface
* @return string[]
*/
protected function registering()
protected function middlewares(): array
{
$route = $this->app['config']->get('catch.route');
$route['middlewares'][] = PermissionGate::class;
$this->app['config']->set('catch.route', $route);
return [PermissionGate::class];
}
/**
@@ -35,7 +28,4 @@ class PermissionsServiceProvider extends CatchModuleServiceProvider
// TODO: Implement path() method.
return CatchAdmin::getModuleRoutePath('Permissions');
}
}