Created
January 19, 2021 02:10
-
-
Save zhanang19/07748a5c8f3b13256024a55e65315cce to your computer and use it in GitHub Desktop.
Developer command
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Console\Commands; | |
use Illuminate\Console\Command; | |
use Illuminate\Support\Facades\Schema; | |
class DevCommand extends Command | |
{ | |
protected $signature = 'dev'; | |
protected $description = 'Developer command'; | |
protected $hidden = true; | |
public function handle() | |
{ | |
$this->getOutput()->writeln("Running <info>`php artisan optimize:clear`</info>"); | |
$this->callSilently('optimize:clear', [ | |
'--no-interaction' => true | |
]); | |
$this->getOutput()->writeln("Running <info>`php artisan event:clear`</info>"); | |
$this->callSilently('event:clear', [ | |
'--no-interaction' => true | |
]); | |
if (class_exists(\Barryvdh\Debugbar\Console\ClearCommand::class)) { | |
$this->info("Clear the Debugbar Storage"); | |
$this->callSilently('debugbar:clear', [ | |
'--no-interaction' => true | |
]); | |
} | |
if (Schema::hasTable('password_resets')) { | |
$this->info("Flush expired password reset tokens"); | |
$this->callSilently('auth:clear-resets'); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment