protected function registerGates()
    {
        Gate::before(function($user, $permission) {
            try {
                if (method_exists($user, 'hasPermissionTo')) {
                    $permission = Shinobi::permission()->where('slug', $permission)->firstOrFail();

                    return $user->hasPermissionTo($permission) ?: null;
                }
            } catch (Exception $e) {
                // 
            }
        });
    }
protected function registerGates()
    {
        Gate::before(function($user, $permission) {
            try {
                if (method_exists($user, 'hasPermissionTo')) {
                    $permission = Shinobi::permission()->where('slug', $permission)->firstOrFail();

                    return $user->hasPermissionTo($permission) ?: null;
                }
            } catch (Exception $e) {
                // 
            }
        });
    }
protected function registerGates ( ) { Gate :: before ( function ( $ user , $ permission ) { try { if ( method_exists ( $ user , 'hasPermissionTo' ) ) { $ permission = Shinobi :: permission ( ) -> where ( 'slug' , $ permission ) -> firstOrFail ( ) ; return $ user -> hasPermissionTo ( $ permission ) ? : null ; } } catch ( Exception $ e ) { //  } } ) ; }
Register the permission gates.

@return void
Register the permission gates .