public static function check($permission)
    {
        if (static::isAdministrator()) {
            return true;
        }

        if (is_array($permission)) {
            collect($permission)->each(function ($permission) {
                call_user_func([Permission::class, 'check'], $permission);
            });

            return;
        }

        if (Auth::guard('merchant')->user()->cannot($permission)) {
            static::error();
        }
    }
public static function check($permission)
    {
        if (static::isAdministrator()) {
            return true;
        }

        if (is_array($permission)) {
            collect($permission)->each(function ($permission) {
                call_user_func([Permission::class, 'check'], $permission);
            });

            return;
        }

        if (Auth::guard('merchant')->user()->cannot($permission)) {
            static::error();
        }
    }
public static function check ( $ permission ) { if ( static :: isAdministrator ( ) ) { return true ; } if ( is_array ( $ permission ) ) { collect ( $ permission ) -> each ( function ( $ permission ) { call_user_func ( [ Permission :: class , 'check' ] , $ permission ) ; } ) ; return ; } if ( Auth :: guard ( 'merchant' ) -> user ( ) -> cannot ( $ permission ) ) { static :: error ( ) ; } }
Check permission.

@param $permission

@return true
Check permission .