Lots of changes
This commit is contained in:
+10
-4
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user