In the browser version of the application there is no possibility to register, the only users are admins. Then it will be possible. Create a migration in which we add the admin column to the users table.
class UsersColumnAdmin extends Migration { public function up() { Schema::table('users', function (Blueprint $table) { $table->boolean('admin')->default(false); }); } public function down() { Schema::table('users', function (Blueprint $table) { $table->dropColumn('admin'); }); } } There is a samopisnaya Artisan create-admin command that asks the user for email, password, etc. to create admin and creates it. You need to make a call to this command from the migration so that when the migration rolls in, allowing you to define the admin role, the system immediately asks about the creation of the first administrator.
public function up() { Schema::table('users', function (Blueprint $table) { $table->boolean('admin')->default(false); }); Artisan::call('create-admin'); } With this approach, when you try to roll a migration, the interface hangs and probably tries to communicate with the user in some other stdout, and waits for a response from the first confirm'a. That is, nothing appears in the console. Question: how to get a copy of the current CLI and forward it to my team?
PS Unlike seeders, migrations are completely empty and do not have an interface for working with the console.
PPS There is a possibility that such an approach is fundamentally wrong, since the smart guys from Laravel decided not to include the possibility of spamming something in the console between migrations. Maybe this then has a reasonable explanation, and how then is it most reasonable to implement an interface for my project?
php artisan migrate --seed- Yaroslav Molchan