57 lines
1.1 KiB
PHP
57 lines
1.1 KiB
PHP
<?php
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class ChiamataPostIt extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
protected $table = 'chiamate_post_it';
|
|
|
|
protected $fillable = [
|
|
'stabile_id',
|
|
'rubrica_id',
|
|
'ticket_id',
|
|
'creato_da_user_id',
|
|
'telefono',
|
|
'nome_chiamante',
|
|
'direzione',
|
|
'esito',
|
|
'origine',
|
|
'origine_id',
|
|
'oggetto',
|
|
'nota',
|
|
'priorita',
|
|
'stato',
|
|
'chiamata_il',
|
|
];
|
|
|
|
protected $casts = [
|
|
'chiamata_il' => 'datetime',
|
|
'created_at' => 'datetime',
|
|
'updated_at' => 'datetime',
|
|
];
|
|
|
|
public function rubrica()
|
|
{
|
|
return $this->belongsTo(RubricaUniversale::class, 'rubrica_id');
|
|
}
|
|
|
|
public function stabile()
|
|
{
|
|
return $this->belongsTo(Stabile::class, 'stabile_id');
|
|
}
|
|
|
|
public function ticket()
|
|
{
|
|
return $this->belongsTo(Ticket::class, 'ticket_id');
|
|
}
|
|
|
|
public function creatoDa()
|
|
{
|
|
return $this->belongsTo(User::class, 'creato_da_user_id');
|
|
}
|
|
}
|