phpvms/app/Console/Commands/ComposerCommand.php
Nabeel S 23eb9dcbda
384 Laravel 6 changes (#385)
* 384 Laravel 6 changes

* Library versions

* Update package versions

* Add keyType to models

* Remove unused dependencies

* StyleCI fixes

* Fix models for test

* Fix tests output and update test runner

* Unused imports

* Update exceptions handler

* Fix login page
2019-09-13 08:05:02 -04:00

41 lines
1017 B
PHP

<?php
namespace App\Console\Commands;
use App\Console\Command;
use Illuminate\Support\Facades\Artisan;
class ComposerCommand extends Command
{
protected $signature = 'phpvms:composer {cmd}';
protected $description = 'Composer related tasks';
/**
* Run composer update related commands
*/
public function handle()
{
switch (trim($this->argument('cmd'))) {
case 'post-update':
$this->postUpdate();
break;
default:
$this->error('Command exists');
}
}
/**
* Any composer post update tasks
*/
protected function postUpdate(): void
{
if (config('app.env') === 'dev') {
/* @noinspection NestedPositiveIfStatementsInspection */
if (class_exists(\Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider::class)) {
Artisan::call('ide-helper:generate');
Artisan::call('ide-helper:meta');
}
}
}
}