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

47 lines
937 B
PHP

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