'date', 'max_participants' => 'integer', 'current_participants' => 'integer', 'status' => ScheduleStatus::class, ]; public function divingOffer() { return $this->belongsTo(DivingOffer::class); } public function provider() { return $this->belongsTo(User::class, 'provider_id'); } public function bookings() { return $this->hasMany(Booking::class, 'schedule_id'); } public function remainingSpots(): int { return max(0, $this->max_participants - $this->current_participants); } protected function startTime(): Attribute { return Attribute::make( get: fn($value) => $value ? substr($value, 0, 5) : $value, ); } }