using cloude sonet 3.5 i have used the prompt to create the migrations and their files and installed api package

This commit is contained in:
ghassan committed 2026-01-20 10:06:01 +03:00
1 parent f27b5abf02
commit 4a7353e3fc
23 files changed
+1871 -2

No files matched your search

+60
View File
@@ -0,0 +1,60 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
class Invoice extends Model
{
use HasFactory;
/**
* The attributes that are mass assignable.
*
* @var array<int, string>
*/
protected $fillable = [
'tenant_id',
'amount',
'status',
'due_date',
'student_user_id',
'payer_user_id',
];
/**
* The attributes that should be cast.
*
* @var array<string, string>
*/
protected $casts = [
'amount' => 'decimal:2',
'due_date' => 'date',
];
/**
* Get the tenant that owns the invoice.
*/
public function tenant(): BelongsTo
{
return $this->belongsTo(Tenant::class);
}
/**
* Get the student user that owns the invoice.
*/
public function student(): BelongsTo
{
return $this->belongsTo(User::class, 'student_user_id');
}
/**
* Get the payer user that owns the invoice.
*/
public function payer(): BelongsTo
{
return $this->belongsTo(User::class, 'payer_user_id');
}
}