Enable registration on no users table
I want to enable register when there aren't users registered on the application, that would be it's the first admin, and after that to disable it.
Solution:Jump to solution
Interesting, so your users are non-tech users on top of tech installation. Unfortunately I don't know a simple way to enable registration on some condition.
Possibly create a custom Register class, and inside of it, check if there's already a user, and if there is, redirect to somewhere or throw error...
5 Replies
Isn't it better to create a Laravel seeder for the first admin, or some kind of Artisan command like make: filament-user? Or do you need specifically registration FORM?
I mean, there is an already command to create an admin user. We we're thinking in making the user experience as smooth as possible for new panel installation.
Solution
Interesting, so your users are non-tech users on top of tech installation. Unfortunately I don't know a simple way to enable registration on some condition.
Possibly create a custom Register class, and inside of it, check if there's already a user, and if there is, redirect to somewhere or throw error
Yes, I think that would be the best case with custom register logic. Thanks Povilas, long time no see. Glad to get a response from you.
Pleasure to help! Good to be back in Filament world, feels back home π