I am creating a Laravel project for the users. Laravel has its own laravel/ui
package, but I am creating its admin panel too, and I am a bit confused about what I should do for admins. Also, I am confused about the security for the admin panel. So there are 2 solutions in my mind:
- Add a new column in the user's table named
status,
and if its value is admin, he can access the admin panel; otherwise, redirect to the homepage. - Create a separate admins table and improve
laravel/ui auth
. For that, I found documentation here.
What should I do? Even i have added table prefix
for tables in .env
& config/database.php
. I am afraid that the hackers/users should not access the admin panel. And also, tell me if the table prefix is good for security, or should I remove the table prefix?