'integer', 'week_number' => 'integer', 'day_number' => 'integer', 'is_public' => 'boolean', ]; public function user(): BelongsTo { return $this->belongsTo(User::class); } public function program(): BelongsTo { return $this->belongsTo(Program::class); } public function assignedByTrainer(): BelongsTo { return $this->belongsTo(User::class, 'assigned_by_trainer_id'); } public function items(): HasMany { return $this->hasMany(WorkoutExercise::class)->orderBy('position'); } public function exercises(): BelongsToMany { return $this->belongsToMany(Exercise::class, 'workout_exercises') ->withPivot(['id', 'position', 'sets', 'reps', 'weight', 'rest_seconds', 'notes']) ->withTimestamps() ->orderBy('workout_exercises.position'); } public function favoritedBy() { return $this->belongsToMany(User::class, 'workout_favorites')->withTimestamps(); } }