src/PermissionsChecker.php
public static function check($permissions)
    {
        if (Schema::hasTable('laralum_permissions')) {
            foreach ($permissions as $permission) {
                if (!self::allCached()->contains('slug', $permission['slug'])) {
                    Cache::forget('laralum_permissions');
                    if (!self::allCached()->contains('slug', $permission['slug'])) {
                        Permission::create([
                            'name'        => $permission['name'],
                            'slug'        => $permission['slug'],
                            'description' => $permission['desc'],
                        ]);
                    }
                }
            }
        }
        session(['laralum_permissions::mandatory' => array_merge(static::mandatory(), $permissions)]);
    }
public static function check($permissions)
    {
        if (Schema::hasTable('laralum_permissions')) {
            foreach ($permissions as $permission) {
                if (!self::allCached()->contains('slug', $permission['slug'])) {
                    Cache::forget('laralum_permissions');
                    if (!self::allCached()->contains('slug', $permission['slug'])) {
                        Permission::create([
                            'name'        => $permission['name'],
                            'slug'        => $permission['slug'],
                            'description' => $permission['desc'],
                        ]);
                    }
                }
            }
        }
        session(['laralum_permissions::mandatory' => array_merge(static::mandatory(), $permissions)]);
    }
public static function check ( $ permissions ) { if ( Schema :: hasTable ( 'laralum_permissions' ) ) { foreach ( $ permissions as $ permission ) { if ( ! self :: allCached ( ) -> contains ( 'slug' , $ permission [ 'slug' ] ) ) { Cache :: forget ( 'laralum_permissions' ) ; if ( ! self :: allCached ( ) -> contains ( 'slug' , $ permission [ 'slug' ] ) ) { Permission :: create ( [ 'name' => $ permission [ 'name' ] , 'slug' => $ permission [ 'slug' ] , 'description' => $ permission [ 'desc' ] , ] ) ; } } } } session ( [ 'laralum_permissions::mandatory' => array_merge ( static :: mandatory ( ) , $ permissions ) ] ) ; }
Checks if the permisions exists and if they dont, they will be added.

@param array $permissions
Checks if the permisions exists and if they dont they will be added .