ldc-legaulois/app/Models/Notifications.php
Jérémy Munsch a861e75538 Message
Refactor Code Notifications
2021-03-10 17:16:31 +01:00

25 lines
431 B
PHP

<?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();
}
}