FilamentF
Filament3y ago
Wim

Adding routes to Filament auth middleware

I have a Filament user panel where a website user can do normal CRUD operations after he logs in.

I want to integrate Stripe billing in the user panel. I can show the (typical) Stripe logout form. I would like this form to be only available when a user is logged in in the user panel. A user that is not loggin in should be redirected to the login page. The associated route is under /user/billing.

I was adding it to my usual Laravel routes file as follows:

Route::middleware('auth')->group(function () { Route::get('/user/billing', Billing::class)->name('billing'); });

but then I get the Route [login] not defined because it checks the app\Http\Middleware\Authenticate.php file which does refer to login (but not the login from Filament).

Any idea how to fix this?
Solution
Thanks. Based on your response I have tried two things. Both work
Was this page helpful?