installer fixes; user's name
This commit is contained in:
@@ -2,6 +2,10 @@
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use App\Models\Airline;
|
||||
use App\Models\Permission;
|
||||
use App\Models\Role;
|
||||
use App\Models\User;
|
||||
use App\Services\DatabaseService;
|
||||
use DB;
|
||||
|
||||
@@ -28,8 +32,8 @@ class DevCommands extends BaseCommand
|
||||
|
||||
$commands = [
|
||||
'clear-acars' => 'clearAcars',
|
||||
'clear-users' => 'clearUsers',
|
||||
'compile-assets' => 'compileAssets',
|
||||
'test-api' => 'testApi',
|
||||
];
|
||||
|
||||
if(!array_key_exists($command, $commands)) {
|
||||
@@ -59,6 +63,26 @@ class DevCommands extends BaseCommand
|
||||
$this->info('ACARS and PIREPs cleared!');
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete all the data from the ACARS and PIREP tables
|
||||
*/
|
||||
protected function clearUsers()
|
||||
{
|
||||
if (config('database.default') === 'mysql') {
|
||||
DB::statement('SET foreign_key_checks=0');
|
||||
}
|
||||
|
||||
DB::statement('TRUNCATE `role_user`');
|
||||
Airline::truncate();
|
||||
User::truncate();
|
||||
|
||||
if (config('database.default') === 'mysql') {
|
||||
DB::statement('SET foreign_key_checks=1');
|
||||
}
|
||||
|
||||
$this->info('Users cleared!');
|
||||
}
|
||||
|
||||
/**
|
||||
* Compile all the CSS/JS assets into their respective files
|
||||
* Calling the webpack compiler
|
||||
|
||||
Reference in New Issue
Block a user