app/Providers/AuthServiceProvider.php
/**
     * Register any authentication / authorization services.
     *
     * @return void
     */
Register any authentication / authorization services.
@return void
Register any authentication / authorization services . @return void
public function boot()
    {
        $this->registerPolicies();
        Gate::define('category-list', 'App\Policies\CategoryPolicy@view');
        Gate::define('category-add', 'App\Policies\CategoryPolicy@create');
        Gate::define('category-edit', 'App\Policies\CategoryPolicy@update');
        Gate::define('category-delete', 'App\Policies\CategoryPolicy@delete');
        Gate::define('menu-list', 'App\Policies\MenuPolicy@view');
        Gate::define('menu-add', 'App\Policies\MenuPolicy@create');
        Gate::define('menu-edit', 'App\Policies\MenuPolicy@update');
        Gate::define('menu-delete', 'App\Policies\MenuPolicy@delete');
        Gate::define('slider-list', 'App\Policies\SliderPolicy@view');
        Gate::define('slider-add', 'App\Policies\SliderPolicy@create');
        Gate::define('slider-edit', 'App\Policies\SliderPolicy@update');
        Gate::define('slider-delete', 'App\Policies\SliderPolicy@delete');
        Gate::define('product-list', 'App\Policies\ProductPolicy@view');
        Gate::define('product-add', 'App\Policies\ProductPolicy@create');
        Gate::define('product-edit', 'App\Policies\ProductPolicy@update');
        Gate::define('product-delete', 'App\Policies\ProductPolicy@delete');
        Gate::define('setting-list', 'App\Policies\SettingPolicy@view');
        Gate::define('setting-add', 'App\Policies\SettingPolicy@create');
        Gate::define('setting-edit', 'App\Policies\SettingPolicy@update');
        Gate::define('setting-delete', 'App\Policies\SettingPolicy@delete');
        Gate::define('role-list', 'App\Policies\RolePolicy@view');
        Gate::define('role-add', 'App\Policies\RolePolicy@create');
        Gate::define('role-edit', 'App\Policies\RolePolicy@update');
        Gate::define('role-delete', 'App\Policies\RolePolicy@delete');
    }
public function boot ( ) { $ this -> registerPolicies ( ) ; Gate :: define ( 'category-list' , 'App\Policies\CategoryPolicy@view' ) ; Gate :: define ( 'category-add' , 'App\Policies\CategoryPolicy@create' ) ; Gate :: define ( 'category-edit' , 'App\Policies\CategoryPolicy@update' ) ; Gate :: define ( 'category-delete' , 'App\Policies\CategoryPolicy@delete' ) ; Gate :: define ( 'menu-list' , 'App\Policies\MenuPolicy@view' ) ; Gate :: define ( 'menu-add' , 'App\Policies\MenuPolicy@create' ) ; Gate :: define ( 'menu-edit' , 'App\Policies\MenuPolicy@update' ) ; Gate :: define ( 'menu-delete' , 'App\Policies\MenuPolicy@delete' ) ; Gate :: define ( 'slider-list' , 'App\Policies\SliderPolicy@view' ) ; Gate :: define ( 'slider-add' , 'App\Policies\SliderPolicy@create' ) ; Gate :: define ( 'slider-edit' , 'App\Policies\SliderPolicy@update' ) ; Gate :: define ( 'slider-delete' , 'App\Policies\SliderPolicy@delete' ) ; Gate :: define ( 'product-list' , 'App\Policies\ProductPolicy@view' ) ; Gate :: define ( 'product-add' , 'App\Policies\ProductPolicy@create' ) ; Gate :: define ( 'product-edit' , 'App\Policies\ProductPolicy@update' ) ; Gate :: define ( 'product-delete' , 'App\Policies\ProductPolicy@delete' ) ; Gate :: define ( 'setting-list' , 'App\Policies\SettingPolicy@view' ) ; Gate :: define ( 'setting-add' , 'App\Policies\SettingPolicy@create' ) ; Gate :: define ( 'setting-edit' , 'App\Policies\SettingPolicy@update' ) ; Gate :: define ( 'setting-delete' , 'App\Policies\SettingPolicy@delete' ) ; Gate :: define ( 'role-list' , 'App\Policies\RolePolicy@view' ) ; Gate :: define ( 'role-add' , 'App\Policies\RolePolicy@create' ) ; Gate :: define ( 'role-edit' , 'App\Policies\RolePolicy@update' ) ; Gate :: define ( 'role-delete' , 'App\Policies\RolePolicy@delete' ) ; }
Register any authentication / authorization services.
Register any authentication / authorization services .
//define Category //define Menu //define Slider //define Product //define Setting //define User(Đang bug) // Gate::define('usser-list', 'App\Policies\UserPolicy@view'); // Gate::define('setting-add', 'App\Policies\UserPolicy@create'); // Gate::define('setting-edit', 'App\Policies\UserPolicy@update'); // Gate::define('setting-delete', 'App\Policies\UserPolicy@delete'); //define Role