*/ protected $fillable = [ 'tenant_id', 'name', 'duration_minutes', 'frequency_per_week', 'facility_id', 'schedule', 'description', ]; /** * The attributes that should be cast. * * @var array */ protected $casts = [ 'duration_minutes' => 'integer', 'frequency_per_week' => 'integer', 'schedule' => 'array', ]; /** * Get the club that owns the activity. */ public function tenant(): BelongsTo { return $this->belongsTo(Tenant::class); } /** * Get the facility where the activity takes place. */ public function facility(): BelongsTo { return $this->belongsTo(ClubFacility::class, 'facility_id'); } /** * Get the packages that include this activity. */ public function packages(): BelongsToMany { return $this->belongsToMany(ClubPackage::class, 'club_package_activities', 'activity_id', 'package_id') ->withPivot('instructor_id') ->withTimestamps(); } }