%PDF- %PDF-
Direktori : /home/silvzytp/crm-dub-code/app/Providers/ |
Current File : /home/silvzytp/crm-dub-code/app/Providers/AppServiceProvider.php |
<?php namespace App\Providers; use App\Models\User; use App\Models\Permission; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Blade; use Illuminate\Support\Facades\Schema; use Illuminate\Support\ServiceProvider; class AppServiceProvider extends ServiceProvider { /** * Register any application services. * * @return void */ public function register() { // } /** * Bootstrap any application services. * * @return void */ public function boot() { Schema::defaultStringLength(191); Blade::if('permission', function ($permission){ return Auth::user()->role->permissions->where('slug',$permission)->first() ? true : false; }); Blade::if('super_admin', function ($role_slug) { return Auth::user()->role->slug == $role_slug ? true : false; }); } }