ldc-legaulois/app/Models/Notifications.php

26 lines
431 B
PHP
Raw Normal View History

<?php
namespace App\Models;
use App\Enums\NotificationType;
use Illuminate\Database\Eloquent\Model;
class Notifications extends Model
{
protected $enumCasts = [
'type' => NotificationType::class
];
protected $fillable = [
'type',
'content'
];
/**
* Polymorphic relation : Get the parent model
*/
public function notifiable() {
return $this->morphTo();
}
}