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('manage-users', function($user) {
            return $user->hasRole('admin');
        });
        Gate::define('edit-users', function($user) {
            return $user->hasRole('admin');
        });
        Gate::define('delete-users', function($user) {
            return $user->hasRole('admin');
        });
        Gate::define('manage-students', function($user) {
            return $user->hasRole('admin');
        });
        Gate::define('manage-tutors', function($user) {
            return $user->hasRole('admin');
        });
        Gate::define('manage-payments', function($user) {
            return $user->hasRole('admin');
        });
        Gate::define('manage-cms', function($user) {
            return $user->hasRole('admin');
        });
        Gate::define('manage-reports', function($user) {
            return $user->hasRole('admin');
        });
        Gate::define('manage-system', function($user) {
            return $user->hasRole('admin');
        });
        Gate::define('manage-tutoring-resource', function($user) {
            return $user->hasAnyRoles(['admin','tutor']);
        });
        Gate::define('manage-payment-records', function($user) {
            return $user->hasRole('tutor');
        });
        Gate::define('manage-tutor-students', function($user) {
            return $user->hasRole('tutor');
        });
        Gate::define('manage-essay', function($user) {
            return $user->hasRole('tutor');
        });
        Gate::define('manage-sessions', function($user) {
            return $user->hasRole('tutor');
        });
        Gate::define('manage-report-cards', function($user) {
            return $user->hasRole('tutor');
        });
        Gate::define('manage-student-tutors', function($user) {
            return $user->hasRole('student');
        });
        Gate::define('manage-invoices', function($user) {
            return $user->hasRole('student');
        });
        Gate::define('manage-add-student', function($user) {
            return $user->hasRole('student');
        });
        Gate::define('manage-discount-package', function($user) {
            return $user->hasRole('student');
        });
        Gate::define('manage-student-reports', function($user) {
            return $user->hasRole('student');
        });
        Passport::routes();
        Passport::loadKeysFrom(base_path().'\storage\secret-keys\oauth');
    }
public function boot ( ) { $ this -> registerPolicies ( ) ; Gate :: define ( 'manage-users' , function ( $ user ) { return $ user -> hasRole ( 'admin' ) ; } ) ; Gate :: define ( 'edit-users' , function ( $ user ) { return $ user -> hasRole ( 'admin' ) ; } ) ; Gate :: define ( 'delete-users' , function ( $ user ) { return $ user -> hasRole ( 'admin' ) ; } ) ; Gate :: define ( 'manage-students' , function ( $ user ) { return $ user -> hasRole ( 'admin' ) ; } ) ; Gate :: define ( 'manage-tutors' , function ( $ user ) { return $ user -> hasRole ( 'admin' ) ; } ) ; Gate :: define ( 'manage-payments' , function ( $ user ) { return $ user -> hasRole ( 'admin' ) ; } ) ; Gate :: define ( 'manage-cms' , function ( $ user ) { return $ user -> hasRole ( 'admin' ) ; } ) ; Gate :: define ( 'manage-reports' , function ( $ user ) { return $ user -> hasRole ( 'admin' ) ; } ) ; Gate :: define ( 'manage-system' , function ( $ user ) { return $ user -> hasRole ( 'admin' ) ; } ) ; Gate :: define ( 'manage-tutoring-resource' , function ( $ user ) { return $ user -> hasAnyRoles ( [ 'admin' , 'tutor' ] ) ; } ) ; Gate :: define ( 'manage-payment-records' , function ( $ user ) { return $ user -> hasRole ( 'tutor' ) ; } ) ; Gate :: define ( 'manage-tutor-students' , function ( $ user ) { return $ user -> hasRole ( 'tutor' ) ; } ) ; Gate :: define ( 'manage-essay' , function ( $ user ) { return $ user -> hasRole ( 'tutor' ) ; } ) ; Gate :: define ( 'manage-sessions' , function ( $ user ) { return $ user -> hasRole ( 'tutor' ) ; } ) ; Gate :: define ( 'manage-report-cards' , function ( $ user ) { return $ user -> hasRole ( 'tutor' ) ; } ) ; Gate :: define ( 'manage-student-tutors' , function ( $ user ) { return $ user -> hasRole ( 'student' ) ; } ) ; Gate :: define ( 'manage-invoices' , function ( $ user ) { return $ user -> hasRole ( 'student' ) ; } ) ; Gate :: define ( 'manage-add-student' , function ( $ user ) { return $ user -> hasRole ( 'student' ) ; } ) ; Gate :: define ( 'manage-discount-package' , function ( $ user ) { return $ user -> hasRole ( 'student' ) ; } ) ; Gate :: define ( 'manage-student-reports' , function ( $ user ) { return $ user -> hasRole ( 'student' ) ; } ) ; Passport :: routes ( ) ; Passport :: loadKeysFrom ( base_path ( ) . '\storage\secret-keys\oauth' ) ; }
Register any authentication / authorization services.
Register any authentication / authorization services .
// Tutor Related // Student Related