36 lines
666 B
PHP
36 lines
666 B
PHP
<?php
|
|
|
|
namespace Modules\Admin\App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class ContactableItem extends Model
|
|
{
|
|
protected $table = 'contactable_items';
|
|
|
|
protected $fillable = [
|
|
'contactable_id',
|
|
'contactable_type',
|
|
'type',
|
|
'data_contact',
|
|
'is_preferred',
|
|
'preference_level',
|
|
];
|
|
|
|
/**
|
|
* Casts for the model attributes.
|
|
*/
|
|
protected $casts = [
|
|
'is_preferred' => 'boolean',
|
|
'preference_level' => 'integer',
|
|
];
|
|
|
|
/**
|
|
* Polymorphic relationship to the parent model.
|
|
*/
|
|
public function contactable()
|
|
{
|
|
return $this->morphTo();
|
|
}
|
|
}
|