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('first-register', function(?User $user){
            return User::all()->count() == 0;
        });
        Gate::define('register', function(User $user){
            return $user->hasAdminAccess();
        });
        Gate::define('image-upload', function(User $user){
            return $user->hasEditorAccess();
        });
        Gate::define('image-download', function(User $user){
            return $user->hasEditorAccess();;
        });
        Gate::define('image-delete', function(User $user){
            return $user->hasEditorAccess();;
        });
    }
public function boot ( ) { $ this -> registerPolicies ( ) ; Gate :: define ( 'first-register' , function ( ? User $ user ) { return User :: all ( ) -> count ( ) == 0 ; } ) ; Gate :: define ( 'register' , function ( User $ user ) { return $ user -> hasAdminAccess ( ) ; } ) ; Gate :: define ( 'image-upload' , function ( User $ user ) { return $ user -> hasEditorAccess ( ) ; } ) ; Gate :: define ( 'image-download' , function ( User $ user ) { return $ user -> hasEditorAccess ( ) ; ; } ) ; Gate :: define ( 'image-delete' , function ( User $ user ) { return $ user -> hasEditorAccess ( ) ; ; } ) ; }
Register any authentication / authorization services.
Register any authentication / authorization services .