catchAdmin/modules/Permissions/Providers/PermissionsServiceProvider.php

42 lines
918 B
PHP
Raw Normal View History

2022-12-05 23:01:12 +08:00
<?php
namespace Modules\Permissions\Providers;
use Catch\CatchAdmin;
use Catch\Providers\CatchModuleServiceProvider;
2022-12-14 19:25:52 +08:00
use Modules\Permissions\Middlewares\PermissionGate;
2022-12-18 22:44:58 +08:00
use Modules\Permissions\Models\LogOperate;
2022-12-05 23:01:12 +08:00
class PermissionsServiceProvider extends CatchModuleServiceProvider
{
2022-12-14 19:25:52 +08:00
/**
* register permission gate
*
* @throws \Psr\Container\ContainerExceptionInterface
* @throws \Psr\Container\NotFoundExceptionInterface
*/
protected function registering()
{
$route = $this->app['config']->get('catch.route');
$route['middlewares'][] = PermissionGate::class;
$this->app['config']->set('catch.route', $route);
}
2022-12-05 23:01:12 +08:00
/**
* route path
*
* @return string|array
*/
public function routePath(): string|array
{
// TODO: Implement path() method.
return CatchAdmin::getModuleRoutePath('Permissions');
}
2022-12-18 22:44:58 +08:00
2022-12-05 23:01:12 +08:00
}