37 lines
735 B
PHP
Executable File
37 lines
735 B
PHP
Executable File
<?php
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class AffittoContrattoClausola extends Model
|
|
{
|
|
protected $table = 'affitti_contratto_clausole';
|
|
|
|
protected $fillable = [
|
|
'affitto_id',
|
|
'clausola_id',
|
|
'titolo',
|
|
'testo',
|
|
'periodicita',
|
|
'importo',
|
|
'ordine',
|
|
'attivo',
|
|
];
|
|
|
|
protected $casts = [
|
|
'importo' => 'decimal:2',
|
|
'ordine' => 'integer',
|
|
'attivo' => 'boolean',
|
|
];
|
|
|
|
public function affitto()
|
|
{
|
|
return $this->belongsTo(AffittoImmobile::class, 'affitto_id');
|
|
}
|
|
|
|
public function clausolaTemplate()
|
|
{
|
|
return $this->belongsTo(AffittoClausola::class, 'clausola_id');
|
|
}
|
|
}
|