$permissions * @property Carbon $created_at * @property Carbon $updated_at * @property User $user * @property Server $server */ #[Guarded(['id', 'created_at', 'updated_at'])] class Subuser extends Model { /** @use HasFactory */ use HasFactory; use HasHashid; use Notifiable; /** * The resource name for this model when it is transformed into an * API representation using fractal. */ public const string RESOURCE_NAME = 'server_subuser'; /** * @return array */ protected function casts(): array { return [ 'user_id' => 'int', 'server_id' => 'int', 'permissions' => 'array', ]; } /** * Gets the server associated with a subuser. * * @return BelongsTo */ public function server(): BelongsTo { return $this->belongsTo(Server::class); } /** * Gets the user associated with a subuser. * * @return BelongsTo */ public function user(): BelongsTo { return $this->belongsTo(User::class); } /** * Gets the permissions associated with a subuser. * * @return HasMany */ public function permissions(): HasMany { return $this->hasMany(Permission::class); } }