Files
alrahma_sunday_school_api/app/Models/InvoiceEvent.php
T
2026-03-08 16:33:24 -04:00

42 lines
880 B
PHP
Executable File

<?php
namespace App\Models;
use App\Models\BaseModel;
class InvoiceEvent extends BaseModel
{
protected $table = 'invoice_event';
// ✅ CI: useTimestamps = true (created_at/updated_at)
public $timestamps = true;
protected $fillable = [
'invoice_id',
'event_name',
'description',
'amount',
'semester',
'school_year',
'updated_by',
'created_at',
'updated_at',
];
protected $casts = [
'invoice_id' => 'integer',
'amount' => 'decimal:2', // adjust precision if needed
'updated_by' => 'integer',
];
/* Optional relationships */
public function invoice()
{
return $this->belongsTo(Invoice::class, 'invoice_id');
}
public function updatedByUser()
{
return $this->belongsTo(User::class, 'updated_by');
}
}