feat: new xboard

This commit is contained in:
xboard
2025-01-21 14:57:54 +08:00
parent de18cfe596
commit 0f43fff242
373 changed files with 17923 additions and 20264 deletions
+11
View File
@@ -3,6 +3,7 @@
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasMany;
class ServerGroup extends Model
{
@@ -12,4 +13,14 @@ class ServerGroup extends Model
'created_at' => 'timestamp',
'updated_at' => 'timestamp'
];
public function users(): HasMany
{
return $this->hasMany(User::class, 'group_id', 'id');
}
public function servers()
{
return Server::whereJsonContains('group_ids', (string) $this->id)->get();
}
}