To separate the default routes for the user and admin profiles, you can modify the routes/web.php file.
First, you need to define a new route group for the admin panel with a prefix of /admin. Then, you can move all the admin-related routes (such as login, dashboard, etc.) into this group.
Here's an example of how you can modify the routes/web.php file:
use Illuminate\Support\Facades\Route;
// User routes
Route::get('/', function () {
return view('welcome');
});
require __DIR__.'/auth.php';
// Admin routes
Route::prefix('admin')->group(function () {
Route::get('/login', function () {
return view('admin.login');
});
Route::get('/dashboard', function () {
return view('admin.dashboard');
});
// Add more admin routes here
});
In this example, the user routes are defined first, followed by the admin routes in a separate route group with a prefix of /admin.
You can then move all the admin-related routes (such as login, dashboard, etc.) into this group.
Note that you'll also need to update any links or redirects in your application to use the correct routes for the user and admin profiles.