check()) { return redirect()->route('chat'); } return redirect()->route('login'); }); Route::resource('news', NewsController::class)->except(['show']); Route::middleware('auth')->group(function () { Route::get('/profile', [ProfileController::class, 'edit'])->name('profile.edit'); Route::patch('/profile', [ProfileController::class, 'update'])->name('profile.update'); Route::delete('/profile', [ProfileController::class, 'destroy'])->name('profile.destroy'); Route::get('/chat', [ChatController::class, 'index'])->name('chat'); Route::post('/chat/send', [ChatController::class, 'sendMessage'])->name('chat.send'); }); require __DIR__.'/auth.php';