43 lines
949 B
PHP
Executable File
43 lines
949 B
PHP
Executable File
<?php
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
class AdempimentoFiscale extends Model
|
|
{
|
|
protected $table = 'adempimenti_fiscali';
|
|
|
|
protected $fillable = [
|
|
'tenant_id',
|
|
'stabile_id',
|
|
'gestione_id',
|
|
'tipo',
|
|
'anno_fiscale',
|
|
'titolo',
|
|
'descrizione',
|
|
'stato',
|
|
'scadenza',
|
|
'data_completamento',
|
|
'periodicita',
|
|
'metadati',
|
|
];
|
|
|
|
protected $casts = [
|
|
'anno_fiscale' => 'integer',
|
|
'scadenza' => 'date',
|
|
'data_completamento' => 'date',
|
|
'metadati' => 'array',
|
|
];
|
|
|
|
public function stabile(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Stabile::class, 'stabile_id');
|
|
}
|
|
|
|
public function gestione(): BelongsTo
|
|
{
|
|
return $this->belongsTo(GestioneContabile::class, 'gestione_id');
|
|
}
|
|
}
|