*/ protected $fillable = [ 'name', 'slug' ]; /** * The attributes that should be hidden for serialization. * @var array */ protected $hidden = [ 'updated_at', 'deleted_at' ]; public static function getRolesList(): array { $where = ['status' => 1]; return self::query()->where($where)->select()->get()->toArray(); } public function adminUsers(): BelongsToMany { return $this->belongsToMany( AdminUsers::class, AdminRoleUsers::class, 'role_id', 'user_id' ); } public function menus(): BelongsToMany { return $this->belongsToMany( AdminMenu::class, AdminRoleMenu::class, 'role_id', 'menu_id' ); } }