Уведомления: лента в приложении и письма по каналам
Notify рассылает по каналам database и mail, адресовать можно по праву. Роутер теперь поднимается и вне запроса, появился Router::absolute для писем.
This commit is contained in:
1 parent
7b6ac42f1e
commit
2f162a846f
24 files changed
+1234
-17
No files matched your search
@@ -18,6 +18,7 @@ use App\Controllers\Web\AuthController;
|
||||
use App\Controllers\Web\HomeController;
|
||||
use App\Controllers\Web\InstallController;
|
||||
use App\Controllers\Web\NotesController;
|
||||
use App\Controllers\Web\NotificationsController;
|
||||
use App\Controllers\Web\PasswordController;
|
||||
use App\Controllers\Web\ProfileController;
|
||||
use App\Controllers\Web\RegisterController;
|
||||
@@ -63,6 +64,15 @@ return static function (Router $router): void {
|
||||
$router->post('/profile/devices/revoke', [ProfileController::class, 'revoke'])->name('profile.devices.revoke');
|
||||
$router->post('/profile/devices/others', [ProfileController::class, 'revokeOthers'])->name('profile.devices.others');
|
||||
|
||||
// Свои уведомления смотрит каждый вошедший: право тут ни при чём,
|
||||
// чужих он всё равно не увидит
|
||||
$router->group(['prefix' => '/notifications'], function (Router $router): void {
|
||||
$router->get('', [NotificationsController::class, 'index'])->name('notifications');
|
||||
$router->post('/read', [NotificationsController::class, 'readAll'])->name('notifications.read_all');
|
||||
$router->post('/{id:\d+}/read', [NotificationsController::class, 'read'])->name('notifications.read');
|
||||
$router->post('/{id:\d+}/delete', [NotificationsController::class, 'delete'])->name('notifications.delete');
|
||||
});
|
||||
|
||||
// Демонстрационный раздел: удаляется целиком вместе с моделью,
|
||||
// контроллером, шаблонами и миграцией
|
||||
$router->group(['prefix' => '/notes'], function (Router $router): void {
|
||||
|
||||
Reference in new issue
Block a user