Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

PeterPan's avatar

Best Practise: SuperAdmin Initial Setup: How to make the 1st Registered User SuperAdmin

Laravel already comes out of the box with a generic user/admin auth form and user registeration. When the very 'first' user registers in on a brand new database, what is the best practise around to set this 'first' as the superadmin?

  1. Manually edit the SQL table (e.g "super_admin") column in your User table
  2. Hardcode in your controller code (that processes your initial user registeration form) that id=1 in your User table is automatically identified as SuperAdmin?

Appreciate inputs on this on best practises out there.

0 likes
1 reply
SaeedPrez's avatar

I would probably add the super admin to the seeder, so when you install your application and run php artisan migrate --seed you get your super admin out of the box.

1 like

Please or to participate in this conversation.