Lots of changes

This commit is contained in:
Simon Pocrnjič
2024-11-13 22:11:07 +01:00
parent 90a5858320
commit 953ff38d64
76 changed files with 2822 additions and 427 deletions
+10 -4
View File
@@ -7,26 +7,27 @@
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
use Illuminate\Database\Eloquent\SoftDeletes;
class Contract extends Model
{
/** @use HasFactory<\Database\Factories\ContractFactory> */
use HasFactory;
use Uuid;
use SoftDeletes;
protected $fillable = [
'reference',
'start_date',
'end_date',
'client_id',
'debtor_id',
'client_case_id',
'type_id',
'description'
];
protected $hidden = [
'client_id',
'debtor_id',
'id',
'client_case_id',
'type_id'
];
@@ -35,6 +36,11 @@ public function type(): BelongsTo
return $this->belongsTo(\App\Models\ContractType::class, 'type_id');
}
public function client(): BelongsTo
{
return $this->belongsTo(\App\Models\Person\Person::class, 'client_id');
}
public function debtor(): BelongsTo
{
return $this->belongsTo(\App\Models\Person\Person::class, 'debtor_id');