F
Filamentβ€’8mo ago
Scai

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:
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...
Jump to solution
5 Replies
Povilas K
Povilas Kβ€’8mo ago
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?
Scai
ScaiOPβ€’8mo ago
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
Povilas K
Povilas Kβ€’8mo ago
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
Scai
ScaiOPβ€’8mo ago
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.
Povilas K
Povilas Kβ€’8mo ago
Pleasure to help! Good to be back in Filament world, feels back home πŸ™‚
Want results from more Discord servers?
Add your server