feat: header con mensajes y notificaciones en tiempo real
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -9,3 +9,7 @@ Broadcast::channel('App.Models.User.{id}', function ($user, $id) {
|
||||
Broadcast::channel('chat.{receiverId}', function ($user, $receiverId) {
|
||||
return (int) $user->id === (int) $receiverId;
|
||||
});
|
||||
|
||||
Broadcast::channel('notifications.{userId}', function ($user, $userId) {
|
||||
return (int) $user->id === (int) $userId;
|
||||
});
|
||||
|
||||
+3
-1
@@ -56,7 +56,9 @@ Route::middleware(['auth:sanctum',config('jetstream.auth_session'),'verified',
|
||||
Route::get('/chat', [ChatController::class, 'index'])->name('chat.index');
|
||||
Route::get('/chat/{user}', [ChatController::class, 'show'])->name('chat.show');
|
||||
Route::post('/chat/send', [ChatController::class, 'send'])->name('chat.send');
|
||||
Route::get('/files/{path}', [FileController::class, 'serve'])->where('path', '.*')->name('files.serve');Route::resource('/docente',DocenteController::class);
|
||||
Route::get('/files/{path}', [FileController::class, 'serve'])->where('path', '.*')->name('files.serve');
|
||||
Route::post('/notifications/{id}/read', fn($id) => auth()->user()->notifications()->findOrFail($id)->markAsRead())->name('notifications.read');
|
||||
Route::post('/notifications/read-all', fn() => auth()->user()->unreadNotifications->markAsRead())->name('notifications.read-all');Route::resource('/docente',DocenteController::class);
|
||||
Route::resource('/documento',DocumentoController::class);
|
||||
Route::get('/documento/ver/{id}', function ($id) { $doc = Documento::findOrFail($id); $alumno = auth()->user()->alumnos()->first(); if (!$alumno || $doc->alumno_id !== $alumno->id) { abort(403); } return response()->file( storage_path('app/public/'.$doc->archivo) ); });
|
||||
Route::get('/documento/ver/{id}', [DocumentoController::class, 'ver'])->name('documento.ver');
|
||||
|
||||
Reference in New Issue
Block a user