#4 - wip
This commit is contained in:
24
app/Console/Commands/CreateUserCommand.php
Normal file
24
app/Console/Commands/CreateUserCommand.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Toby\Console\Commands;
|
||||
|
||||
use Illuminate\Console\Command;
|
||||
use Toby\Models\User;
|
||||
|
||||
class CreateUserCommand extends Command
|
||||
{
|
||||
protected $signature = "user:create
|
||||
{email : an email for the user}";
|
||||
protected $description = "Creates user";
|
||||
|
||||
public function handle(): void
|
||||
{
|
||||
$email = $this->argument("email");
|
||||
|
||||
User::factory(["email" => $email])->create();
|
||||
|
||||
$this->info("User has been created");
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user