chore: initial Laravel 13 project setup for eCert MBIP
- Laravel 13.9 + PHP 8.5 + MySQL - Bootstrap 5.3 + jQuery 3.7 + Chart.js (replacing Alpine/Tailwind) - Packages: intervention/image, dompdf, simple-qrcode, league/csv, laravel/breeze, laravel/boost - 17 database migrations: users, programs, qr_codes, participants, attendances, certificates, questionnaires, email_logs, audit_logs - 13 Eloquent models with full relationships - Admin layout (Bootstrap 5 sidebar) + public layout (mobile-first) - Rate limiters: checkin (60/min), certificate (30/min) - Admin seeder: admin@mbip.gov.my - Storage directories + symlink configured Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
34
app/Models/Attendance.php
Normal file
34
app/Models/Attendance.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Attendance extends Model
|
||||
{
|
||||
protected $fillable = [
|
||||
'program_id', 'participant_id', 'program_participant_id',
|
||||
'attendance_source', 'attendance_session',
|
||||
'checked_in_at', 'checked_in_ip', 'user_agent', 'notes',
|
||||
];
|
||||
|
||||
protected function casts(): array
|
||||
{
|
||||
return ['checked_in_at' => 'datetime'];
|
||||
}
|
||||
|
||||
public function program()
|
||||
{
|
||||
return $this->belongsTo(Program::class);
|
||||
}
|
||||
|
||||
public function participant()
|
||||
{
|
||||
return $this->belongsTo(Participant::class);
|
||||
}
|
||||
|
||||
public function programParticipant()
|
||||
{
|
||||
return $this->belongsTo(ProgramParticipant::class);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user