firstcommit
This commit is contained in:
45
app/Console/Commands/ResetRefreshDatabaseCommand.php
Normal file
45
app/Console/Commands/ResetRefreshDatabaseCommand.php
Normal file
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use Illuminate\Console\Command;
|
||||
|
||||
class ResetRefreshDatabaseCommand extends Command
|
||||
{
|
||||
/**
|
||||
* The name and signature of the console command.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'db:reset';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Resets/Refresh the database(ie: dp wipe, migrate, seed)';
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
//-- Wipe the database
|
||||
$this->call('db:wipe');
|
||||
|
||||
//-- Migrate the database
|
||||
$this->call('migrate');
|
||||
|
||||
//-- Seed the database
|
||||
$this->call('db:seed');
|
||||
|
||||
//-- Clear Cache
|
||||
$this->call('optimize:clear');
|
||||
|
||||
//-- Flush Session
|
||||
// $this->call('session:flush');
|
||||
|
||||
return Command::SUCCESS;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user