Files
monica/app/Models/ContactInformation.php
T
2021-12-04 18:26:14 -05:00

46 lines
938 B
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Factories\HasFactory;
class ContactInformation extends Model
{
use HasFactory;
protected $table = 'contact_information';
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'contact_id',
'type_id',
'data',
];
/**
* Get the contact associated with the contact information.
*
* @return BelongsTo
*/
public function contact()
{
return $this->belongsTo(Contact::class);
}
/**
* Get the contact information type associated with the contact information.
*
* @return BelongsTo
*/
public function contactInformationType()
{
return $this->belongsTo(ContactInformationType::class, 'type_id');
}
}