Added System, fixed something with Domain, added 403, start of some other items

This commit is contained in:
Deon George
2021-06-18 00:08:30 +10:00
parent 1e7c05cb90
commit 491d3d55c3
17 changed files with 451 additions and 16 deletions

View File

@@ -0,0 +1,38 @@
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use App\Models\User;
class MakeAdmin extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'make:admin {email : User Email}';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Make a user a system admin';
/**
* Execute the console command.
*
* @return int
*/
public function handle()
{
$o = User::where('email',$this->argument('email'))->firstOrfail();
$o->admin = ! $o->admin;
$o->save();
$this->info(sprintf('User [%s] %s an admin',$o->email,$o->admin ? 'IS' : 'is NOT'));
}
}