mirror of
https://github.com/vitodeploy/vito.git
synced 2025-04-21 10:51:36 +00:00
25 lines
551 B
PHP
25 lines
551 B
PHP
<?php
|
|
|
|
namespace App\Console\Commands;
|
|
|
|
use App\Models\User;
|
|
use Illuminate\Console\Command;
|
|
|
|
class CreateUserCommand extends Command
|
|
{
|
|
protected $signature = 'user:create {name} {email} {password}';
|
|
|
|
protected $description = 'Create a new user';
|
|
|
|
public function handle(): void
|
|
{
|
|
User::create([
|
|
'name' => $this->argument('name'),
|
|
'email' => $this->argument('email'),
|
|
'password' => bcrypt($this->argument('password')),
|
|
]);
|
|
|
|
$this->info('User created with password');
|
|
}
|
|
}
|