/
githubmirror
/
framework
Обзор
Документация
Войти
/
githubmirror
/
framework
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
13.x
src/Illuminate/Notifications/HasDatabaseNotifications.php
36 строк
897 B
Liam Duckett
[12.x] Types: HasDatabaseNotifications read/unread notifications (#57718)
09 ноя 2025, 17:43
Не верифицирован
09 ноя 2025, 17:43
2c0ae1d
Код
Авторство
О чём код?
<?php namespace Illuminate\Notifications; trait HasDatabaseNotifications { /** * Get the entity's notifications. * * @return \Illuminate\Database\Eloquent\Relations\MorphMany<DatabaseNotification, $this> */ public function notifications() { return $this->morphMany(DatabaseNotification::class, 'notifiable')->latest(); } /** * Get the entity's read notifications. * * @return \Illuminate\Database\Eloquent\Relations\MorphMany<DatabaseNotification, $this> */ public function readNotifications() { return $this->notifications()->read(); } /** * Get the entity's unread notifications. * * @return \Illuminate\Database\Eloquent\Relations\MorphMany<DatabaseNotification, $this> */ public function unreadNotifications() { return $this->notifications()->unread(); } }