50 lines
1.0 KiB
PHP
Executable File
50 lines
1.0 KiB
PHP
Executable File
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
use App\Models\RubricaUniversale;
|
|
use App\Models\Stabile;
|
|
use App\Models\UnitaImmobiliare;
|
|
|
|
class RubricaContattoCanale extends Model
|
|
{
|
|
protected $table = 'rubrica_contatti_canali';
|
|
|
|
protected $fillable = [
|
|
'rubrica_id',
|
|
'tipo',
|
|
'etichetta',
|
|
'valore',
|
|
'is_principale',
|
|
'stabile_id',
|
|
'unita_immobiliare_id',
|
|
'data_inizio',
|
|
'data_fine',
|
|
'meta',
|
|
];
|
|
|
|
protected $casts = [
|
|
'is_principale' => 'boolean',
|
|
'data_inizio' => 'date',
|
|
'data_fine' => 'date',
|
|
'meta' => 'array',
|
|
];
|
|
|
|
public function contatto()
|
|
{
|
|
return $this->belongsTo(RubricaUniversale::class, 'rubrica_id');
|
|
}
|
|
|
|
public function stabile()
|
|
{
|
|
return $this->belongsTo(Stabile::class, 'stabile_id');
|
|
}
|
|
|
|
public function unitaImmobiliare()
|
|
{
|
|
return $this->belongsTo(UnitaImmobiliare::class, 'unita_immobiliare_id');
|
|
}
|
|
}
|