first commit
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
class WorkoutExercise extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $fillable = [
|
||||
'workout_id',
|
||||
'exercise_id',
|
||||
'position',
|
||||
'sets',
|
||||
'reps',
|
||||
'weight',
|
||||
'rest_seconds',
|
||||
'notes',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'position' => 'integer',
|
||||
'sets' => 'integer',
|
||||
'reps' => 'integer',
|
||||
'weight' => 'decimal:2',
|
||||
'rest_seconds' => 'integer',
|
||||
];
|
||||
|
||||
public function workout(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Workout::class);
|
||||
}
|
||||
|
||||
public function exercise(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Exercise::class);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user