This repository has been archived on 2024-04-08. You can view files and clone it, but cannot push or open issues or pull requests.
site-base/app/Console/Commands/GenerateCode.php
2018-05-07 21:34:10 +10:00

44 lines
817 B
PHP

<?php
namespace App\Console\Commands;
use Clarkeash\Doorman\Facades\Doorman;
use Illuminate\Console\Command;
class GenerateCode extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'code:generate {email}';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Generate an Access Code for email';
/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
parent::__construct();
}
/**
* Execute the console command.
*
* @return mixed
*/
public function handle()
{
echo Doorman::generate()->for($this->argument('email'))->expiresIn(14)->make();
}
}