|null $permissions */ class Group extends Model { protected function casts(): array { return ['permissions' => 'array']; } public function users(): BelongsToMany { return $this->belongsToMany(config('manager.user_model'), Names::table('group_user'), 'group_id', 'user_id'); } /** * What the group allows, without anything that is no permission (any more), for instance * of a module that was switched off. * * @return list */ public function allowed(): array { return app(ModuleRegistry::class)->complete($this->permissions ?? []); } }