user profiles
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
<?php
|
||||
|
||||
use App\Http\Controllers\ProfileController;
|
||||
use Illuminate\Support\Facades\Route;
|
||||
|
||||
Route::get('/', function () {
|
||||
@@ -9,3 +10,38 @@ Route::get('/', function () {
|
||||
Auth::routes();
|
||||
|
||||
Route::get('/home', [App\Http\Controllers\HomeController::class, 'index'])->name('home');
|
||||
|
||||
// Profile Routes
|
||||
Route::middleware(['auth'])->group(function () {
|
||||
Route::get('/profile/edit', [ProfileController::class, 'edit'])->name('profile.edit');
|
||||
Route::put('/profile', [ProfileController::class, 'update'])->name('profile.update');
|
||||
Route::delete('/profile/avatar', [ProfileController::class, 'deleteAvatar'])->name('profile.avatar.delete');
|
||||
});
|
||||
|
||||
Route::get('/profile/{user}', [ProfileController::class, 'show'])->name('profile.show');
|
||||
|
||||
// Admin Routes (example)
|
||||
Route::middleware(['auth', 'admin'])->prefix('admin')->name('admin.')->group(function () {
|
||||
Route::get('/dashboard', function () {
|
||||
return 'Admin Dashboard';
|
||||
})->name('dashboard');
|
||||
|
||||
Route::get('/users', function () {
|
||||
return 'User Management (Admin Only)';
|
||||
})->name('users.index');
|
||||
|
||||
Route::get('/settings', function () {
|
||||
return 'Settings (Admin Only)';
|
||||
})->name('settings');
|
||||
});
|
||||
|
||||
// Moderator Routes (example)
|
||||
Route::middleware(['auth', 'moderator'])->prefix('moderator')->name('moderator.')->group(function () {
|
||||
Route::get('/dashboard', function () {
|
||||
return 'Moderator Dashboard';
|
||||
})->name('dashboard');
|
||||
|
||||
Route::get('/products/pending', function () {
|
||||
return 'Pending Products (Moderator Only)';
|
||||
})->name('products.pending');
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user