From: Vincent Vanwaelscappel Date: Tue, 28 Jan 2020 14:28:29 +0000 (+0100) Subject: wip #2413 @6 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=436ba5259755ad902d617a246284ac7d920fc61e;p=cubist_cms-back.git wip #2413 @6 --- diff --git a/src/CubistBackpackServiceProvider.php b/src/CubistBackpackServiceProvider.php index 880cabf..2e35c3d 100644 --- a/src/CubistBackpackServiceProvider.php +++ b/src/CubistBackpackServiceProvider.php @@ -8,6 +8,7 @@ use Cubist\Backpack\app\Console\Commands\InstallCommand; use Cubist\Backpack\app\Console\Commands\LocaleCopy; use Cubist\Backpack\app\Console\Commands\LocaleSlugReset; use Cubist\Backpack\app\Console\Commands\SearchIndexCommand; +use Cubist\Backpack\app\Console\Commands\UpdateCommand; use Illuminate\Support\Facades\Blade; use Illuminate\Support\ServiceProvider; @@ -58,6 +59,7 @@ class CubistBackpackServiceProvider extends ServiceProvider { $this->commands([ InstallCommand::class, + UpdateCommand::class, GenerateCommand::class, MigrateCommand::class, SearchIndexCommand::class, diff --git a/src/app/Console/Commands/InstallCommand.php b/src/app/Console/Commands/InstallCommand.php index 50b7b0e..a50a793 100644 --- a/src/app/Console/Commands/InstallCommand.php +++ b/src/app/Console/Commands/InstallCommand.php @@ -18,10 +18,24 @@ class InstallCommand extends CubistCommand public function handle() { - $devPackages = ['barryvdh/laravel-ide-helper', 'filp/whoops', 'laravel/tinker']; + $devPackages = ['barryvdh/laravel-ide-helper', 'filp/whoops', 'laravel/tinker:^1.0']; $commands = [ - 'Install dev dependencies' => ['composer require --dev ' . implode(' ' , $devPackages)], + 'Install backpack' => ['php artisan backpack:base:install', 'php artisan backpack:crud:install'], + 'Install backpack addons' => [ + // BackupManager + 'php artisan vendor:publish --provider="Backpack\BackupManager\BackupManagerServiceProvider"', + 'php artisan backpack:base:add-sidebar-content "
  • Backups
  • "', + // LogManager + 'php artisan backpack:base:add-sidebar-content "
  • Logs
  • "', + // Permission Manager + 'php artisan vendor:publish --provider="Spatie\Permission\PermissionServiceProvider" --tag="migrations"', + 'php artisan migrate', + 'php artisan vendor:publish --provider="Spatie\Permission\PermissionServiceProvider" --tag="config"', + 'php artisan vendor:publish --provider="Backpack\PermissionManager\PermissionManagerServiceProvider"', + 'php artisan backpack:base:add-sidebar-content "
  • Authentication
  • "', + ], + 'Install dev dependencies' => ['composer require --dev ' . implode(' ', $devPackages)], "Dropzone" => 'php artisan gaspertrix:backpack:dropzone:install', 'Laravel media library' => [ 'php artisan vendor:publish --provider="Spatie\MediaLibrary\MediaLibraryServiceProvider" --tag="migrations"', @@ -32,7 +46,7 @@ class InstallCommand extends CubistCommand 'php artisan migrate', 'php artisan cubist:magic:migrate' ], - 'Clear caches' => ['php artisan cache:clear'], + 'Clear caches' => ['php artisan optimize:clear'], ]; $this->progressBar = $this->output->createProgressBar(count($commands)); diff --git a/src/app/Console/Commands/UpdateCommand.php b/src/app/Console/Commands/UpdateCommand.php new file mode 100644 index 0000000..9d3982e --- /dev/null +++ b/src/app/Console/Commands/UpdateCommand.php @@ -0,0 +1,43 @@ + ['composer update -v --no-progress --profile --prefer-dist'], + 'Dump autoload' => ['composer dump-autoload'], + 'Clear cache' => ['php artisan optimize:clear'], + 'Generate magic models' => ['php artisan cubist:magic:generate'], + 'Clear caches' => ['php artisan optimize:clear'], + ]; + + $this->progressBar = $this->output->createProgressBar(count($commands)); + $this->progressBar->start(); + $this->info(' Cubist installation, please wait'); + + foreach ($commands as $label => $command) { + $this->line(' Run ' . $label); + if (is_string($command)) { + $command = [$command]; + } + foreach ($command as $cmd) { + $this->executeProcess($cmd); + } + + $this->progressBar->advance(); + } + $this->info(" Cubist successfully installed."); + } +}