feat: funcionalidad de red social (feed, amigos, búsqueda)
- Migraciones: posts, post_likes, post_comments - Modelos Post, PostLike, PostComment con relaciones - User: métodos friendshipWith, isFriendWith, friendIds, posts - PostController: feed, crear publicación con imagen, like toggle, comentarios, eliminar - FriendshipController: listar solicitudes, enviar, aceptar, rechazar, toggle AJAX - SocialProfileController: perfil público con publicaciones y estado de amistad - UserSearchController: búsqueda AJAX por nombre con estado de amistad - FriendRequestNotification: notificación al recibir solicitud - Vistas: feed/index, feed/_post, friendships/index, social/profile - Header: barra de búsqueda con autocomplete AJAX (agregar amigo / mensaje) - Menú lateral: Comunidad, Amigos, Mensajes Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
+23
-1
@@ -8,6 +8,10 @@ use App\Http\Controllers\CampanController;
|
||||
use App\Http\Controllers\CarreraController;
|
||||
use App\Http\Controllers\ChatController;
|
||||
use App\Http\Controllers\FileController;
|
||||
use App\Http\Controllers\FriendshipController;
|
||||
use App\Http\Controllers\PostController;
|
||||
use App\Http\Controllers\SocialProfileController;
|
||||
use App\Http\Controllers\UserSearchController;
|
||||
use App\Http\Controllers\CodeController;
|
||||
use App\Http\Controllers\ConceptoController;
|
||||
use App\Http\Controllers\DocenteController;
|
||||
@@ -58,7 +62,25 @@ Route::middleware(['auth:sanctum',config('jetstream.auth_session'),'verified',
|
||||
Route::post('/chat/send', [ChatController::class, 'send'])->name('chat.send');
|
||||
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::post('/notifications/read-all', fn() => auth()->user()->unreadNotifications->markAsRead())->name('notifications.read-all');
|
||||
|
||||
// Social
|
||||
Route::get('/feed', [PostController::class, 'index'])->name('feed');
|
||||
Route::post('/feed', [PostController::class, 'store'])->name('posts.store');
|
||||
Route::post('/posts/{post}/like', [PostController::class, 'like'])->name('posts.like');
|
||||
Route::post('/posts/{post}/comments', [PostController::class, 'comment'])->name('posts.comment');
|
||||
Route::delete('/posts/{post}', [PostController::class, 'destroy'])->name('posts.destroy');
|
||||
|
||||
Route::get('/friends', [FriendshipController::class, 'index'])->name('friendships.index');
|
||||
Route::post('/friends/{user}/send', [FriendshipController::class, 'send'])->name('friendships.send');
|
||||
Route::post('/friends/{friendship}/accept', [FriendshipController::class, 'accept'])->name('friendships.accept');
|
||||
Route::delete('/friends/{friendship}', [FriendshipController::class, 'destroy'])->name('friendships.destroy');
|
||||
Route::post('/friends/{user}/toggle', [FriendshipController::class, 'toggle'])->name('friendships.toggle');
|
||||
|
||||
Route::get('/search', UserSearchController::class)->name('users.search');
|
||||
Route::get('/perfil/{user}', [SocialProfileController::class, 'show'])->name('social.profile');
|
||||
|
||||
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