芝麻web文件管理V1.00
编辑当前文件:/home/sditechnicalteam/public_html/vendor/mitchbred/entrust/src/Entrust/EntrustServiceProvider.php
publishes([ __DIR__.'/../config/config.php' => app()->basePath() . '/config/entrust.php', ]); // Register commands $this->commands('command.entrust.migration'); // Register blade directives $this->bladeDirectives(); } /** * Register the service provider. * * @return void */ public function register() { $this->registerEntrust(); $this->registerCommands(); $this->mergeConfig(); } /** * Register the blade directives * * @return void */ private function bladeDirectives() { if (!class_exists('\Blade')) return; // Call to Entrust::hasRole Blade::directive('role', function($expression) { return ""; }); Blade::directive('endrole', function($expression) { return ""; }); // Call to Entrust::can Blade::directive('permission', function($expression) { return ""; }); Blade::directive('endpermission', function($expression) { return ""; }); // Call to Entrust::ability Blade::directive('ability', function($expression) { return ""; }); Blade::directive('endability', function($expression) { return ""; }); } /** * Register the application bindings. * * @return void */ private function registerEntrust() { $this->app->bind('entrust', function ($app) { return new Entrust($app); }); $this->app->alias('entrust', 'Trebol\Entrust\Entrust'); } /** * Register the artisan commands. * * @return void */ private function registerCommands() { $this->app->singleton('command.entrust.migration', function ($app) { return new MigrationCommand(); }); } /** * Merges user's and entrust's configs. * * @return void */ private function mergeConfig() { $this->mergeConfigFrom( __DIR__.'/../config/config.php', 'entrust' ); } /** * Get the services provided. * * @return array */ public function provides() { return [ 'command.entrust.migration' ]; } }