reconstruction of the project

This commit is contained in:
root
2026-03-08 16:33:24 -04:00
parent 23b7db1107
commit c8de5f7edc
9157 changed files with 77877 additions and 1073823 deletions
+22 -5
View File
@@ -7,7 +7,10 @@ use App\Models\BaseModel;
class InvoiceEvent extends BaseModel
{
protected $table = 'invoice_event';
protected $primaryKey = 'id';
// ✅ CI: useTimestamps = true (created_at/updated_at)
public $timestamps = true;
protected $fillable = [
'invoice_id',
'event_name',
@@ -19,7 +22,21 @@ class InvoiceEvent extends BaseModel
'created_at',
'updated_at',
];
public $timestamps = true;
const CREATED_AT = 'created_at';
const UPDATED_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');
}
}