Routing issues
Hey all, I'm kind of new to using filament, and I would appreciate some help if possible. I am trying to build a dashboard panel for an admin but i want to use my own route not the preset one from filament.
Route::prefix('admin')->group(function () {
Route::get('dashboard/{id}', [UserController::class, 'showAdminDashboard'])->name('admin.dashboard');
});//LoginForm
public function authenticate(Request $request) {
$credentials = $request->only('email', 'password');
if (Auth::attempt($credentials)) {
$user = Auth::user();
//Check user type
if ($user->user_type === 'admin') {
return redirect()->route('admin.dashboard', ['id' => $user->id])->with('message', 'You are now logged in!');//Admin login
} else {
return redirect()->route('user.dashboard', ['id' => $user->id])->with('message', 'You are now logged in!'); //User Login
}
}
return back()->withInput()->withErrors(['email' => 'Invalid email or password']);
}class AdminPanelProvider extends PanelProvider
{
public function panel(Panel $panel): Panel
{
return $panel
->default()
->id('admin')
->path('admin')
->login()
->colors
...class AdminPanelProvider extends PanelProvider
{
public function panel(Panel $panel): Panel
{
return $panel
->default()
->id('admin')
->path('admin/dashboard/{id}')