fixes
This commit is contained in:
@@ -27,7 +27,7 @@ use App\Http\Controllers\Community\LatestCommentsController;
|
||||
use App\Http\Controllers\Community\InterviewController;
|
||||
use App\Http\Controllers\User\StatisticsController;
|
||||
use App\Http\Controllers\User\ReceivedCommentsController;
|
||||
use App\Http\Controllers\User\UserController as LegacyUserController;
|
||||
|
||||
use App\Http\Controllers\Web\BrowseCategoriesController;
|
||||
use App\Http\Controllers\Web\GalleryController;
|
||||
use App\Http\Controllers\Web\BrowseGalleryController;
|
||||
@@ -123,7 +123,15 @@ Route::middleware('ensure.onboarding.complete')->get('/gallery/{id}/{username?}'
|
||||
|
||||
Route::middleware('auth')->get('/recieved-comments', [ReceivedCommentsController::class, 'index'])->name('legacy.received_comments');
|
||||
|
||||
Route::middleware('auth')->match(['get','post'], '/user', [LegacyUserController::class, 'index'])->name('legacy.user');
|
||||
// Canonical dashboard profile route: serve legacy Nova-themed UI here so the
|
||||
// visual remains identical to the old `/user` page while the canonical path
|
||||
// follows the routing standard `/dashboard/profile`.
|
||||
Route::middleware(['auth'])->match(['get','post'], '/dashboard/profile', [\App\Http\Controllers\Legacy\UserController::class, 'index'])->name('dashboard.profile');
|
||||
|
||||
// Keep legacy `/user` as a permanent redirect to the canonical dashboard path.
|
||||
Route::middleware(['auth'])->match(['get','post'], '/user', function () {
|
||||
return redirect()->route('dashboard.profile', [], 301);
|
||||
})->name('legacy.user.redirect');
|
||||
|
||||
Route::get('/today-in-history', [TodayInHistoryController::class, 'index'])->name('legacy.today_in_history');
|
||||
Route::get('/today-downloads', [TodayDownloadsController::class, 'index'])->name('legacy.today_downloads');
|
||||
@@ -142,15 +150,27 @@ Route::get('/dashboard', function () {
|
||||
return view('dashboard');
|
||||
})->middleware(['auth', 'verified'])->name('dashboard');
|
||||
|
||||
Route::middleware(['auth'])->prefix('dashboard')->name('dashboard.')->group(function () {
|
||||
Route::middleware(['auth', \App\Http\Middleware\NoIndexDashboard::class])->prefix('dashboard')->name('dashboard.')->group(function () {
|
||||
Route::get('/artworks', [DashboardArtworkController::class, 'index'])->name('artworks.index');
|
||||
Route::get('/artworks/{id}/edit', [DashboardArtworkController::class, 'edit'])->whereNumber('id')->name('artworks.edit');
|
||||
Route::put('/artworks/{id}', [DashboardArtworkController::class, 'update'])->whereNumber('id')->name('artworks.update');
|
||||
Route::delete('/artworks/{id}', [DashboardArtworkController::class, 'destroy'])->whereNumber('id')->name('artworks.destroy');
|
||||
// Favorites (user's own favourites)
|
||||
Route::get('/favorites', [\App\Http\Controllers\Dashboard\FavoriteController::class, 'index'])->name('favorites');
|
||||
Route::delete('/favorites/{artwork}', [\App\Http\Controllers\Dashboard\FavoriteController::class, 'destroy'])->name('favorites.destroy');
|
||||
// Followers / Following / Comments (dashboard)
|
||||
Route::get('/followers', [\App\Http\Controllers\Dashboard\FollowerController::class, 'index'])->name('followers');
|
||||
Route::get('/following', [\App\Http\Controllers\Dashboard\FollowingController::class, 'index'])->name('following');
|
||||
Route::get('/comments', [\App\Http\Controllers\Dashboard\CommentController::class, 'index'])->name('comments');
|
||||
// Gallery (user uploads)
|
||||
Route::get('/gallery', [\App\Http\Controllers\Dashboard\DashboardGalleryController::class, 'index'])->name('gallery');
|
||||
});
|
||||
|
||||
Route::middleware(['auth', 'normalize.username', 'ensure.onboarding.complete'])->group(function () {
|
||||
Route::get('/profile', [ProfileController::class, 'edit'])->name('profile.edit');
|
||||
// Redirect legacy `/profile` edit path to canonical dashboard profile route.
|
||||
Route::get('/profile', function () {
|
||||
return redirect()->route('dashboard.profile', [], 301);
|
||||
})->name('legacy.profile.redirect');
|
||||
// Backwards-compatible settings path used by some layouts/links
|
||||
Route::get('/settings', [ProfileController::class, 'edit'])->name('settings');
|
||||
Route::match(['post','put','patch'], '/profile', [ProfileController::class, 'update'])->name('profile.update');
|
||||
|
||||
Reference in New Issue
Block a user