added attendance and fixed body composition

This commit is contained in:
ghassan committed 2026-01-24 13:11:20 +03:00
1 parent 87051e179d
commit 125e1c34af
8 files changed
+293 -4

No files matched your search

+29
View File
@@ -0,0 +1,29 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
class Attendance extends Model
{
protected $table = 'members_attendance';
protected $fillable = [
'member_id',
'session_type',
'trainer_name',
'session_datetime',
'status',
'notes',
];
protected $casts = [
'session_datetime' => 'datetime',
];
public function member(): BelongsTo
{
return $this->belongsTo(User::class, 'member_id');
}
}
+8
View File
@@ -242,6 +242,14 @@ class User extends Authenticatable
return $this->hasMany(Goal::class);
}
/**
* Get the attendance records for the user.
*/
public function attendanceRecords(): HasMany
{
return $this->hasMany(Attendance::class, 'member_id');
}
/**
* Send the email verification notification.
* Override to prevent sending the default Laravel notification.