2021-03-01 14:52:11 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Models;
|
|
|
|
|
|
|
|
|
|
use App\Enums\NotificationType;
|
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
|
|
|
|
|
|
class Notifications extends Model
|
|
|
|
|
{
|
2021-03-20 14:38:15 +01:00
|
|
|
|
2021-03-01 14:52:11 +01:00
|
|
|
protected $enumCasts = [
|
|
|
|
|
'type' => NotificationType::class
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
protected $fillable = [
|
|
|
|
|
'type',
|
2021-04-30 18:40:16 +02:00
|
|
|
'content',
|
|
|
|
|
'customer_id'
|
2021-03-01 14:52:11 +01:00
|
|
|
];
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Polymorphic relation : Get the parent model
|
|
|
|
|
*/
|
2021-03-20 14:38:15 +01:00
|
|
|
public function notifiable()
|
|
|
|
|
{
|
2021-03-01 14:52:11 +01:00
|
|
|
return $this->morphTo();
|
|
|
|
|
}
|
|
|
|
|
}
|