Middleware to check if user has the profile completed
I'm attempting to direct a user to a particular page to complete their registration. The concept is that if they attempt to navigate to any page or resource, they'll be redirected to a custom page I've created where they can complete their registration.
I initially attempted to create a Middleware for this purpose, but encountered an issue where auth()->user() is not available at that moment. Therefore, I'm seeking an alternative method to consistently redirect the user to that page until certain fields in the user's table are filled.
Do you have any suggestions on how I can achieve this?
6 Replies
Where did you put this middleware?
I registered it in the array $middleware, at Kernel.php
you should register in your panel provider
I'm using the v2
How can I register the middleware in the version 2?
ohh sorry
maybe in the config? https://github.com/filamentphp/filament/blob/2.x/packages/admin/config/filament.php
GitHub
filament/packages/admin/config/filament.php at 2.x · filamentphp/fi...
A collection of beautiful full-stack components for Laravel. The perfect starting point for your next app. Using Livewire, Alpine.js and Tailwind CSS. - filamentphp/filament
Awesome! thanks Leandro