Skip to content

Instantly share code, notes, and snippets.

@zhanang19
Created January 19, 2021 02:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zhanang19/07748a5c8f3b13256024a55e65315cce to your computer and use it in GitHub Desktop.
Save zhanang19/07748a5c8f3b13256024a55e65315cce to your computer and use it in GitHub Desktop.
Developer command
<?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