From ddd5aec1d0bd053512785a94ebc60cc2961adacb Mon Sep 17 00:00:00 2001 From: RoelReijn <34895541+RoelReijn@users.noreply.github.com> Date: Sun, 27 Dec 2020 18:53:29 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Updater?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit features a new updater which allows you to republish the views, resources, language files and routes with a single command. Please note that at this moment the updater will override everything previously installed by the installer and any changes which were applied to the file. --- src/Commands/FortifyUITablerUpdateCommand.php | 46 +++++++++++++++++++ src/FortifyUITablerServiceProvider.php | 3 ++ 2 files changed, 49 insertions(+) create mode 100644 src/Commands/FortifyUITablerUpdateCommand.php diff --git a/src/Commands/FortifyUITablerUpdateCommand.php b/src/Commands/FortifyUITablerUpdateCommand.php new file mode 100644 index 0000000..f45690b --- /dev/null +++ b/src/Commands/FortifyUITablerUpdateCommand.php @@ -0,0 +1,46 @@ +confirm('Do you wish to continue? This updater will try to overwrite existing views, resources, language files and routes.', true)) { + // install fortifyUI + \Artisan::call('fortify-ui:install'); + $this->info('FortifyUI has been updated. Proceeding to update Tabler.io.'); + + // publish the assets, routes, controllers, etc. + $this->publishAssets(); + + // create symbolic link + \Artisan::call('storage:link'); + + // Clear the Route cache + \Artisan::call('route:clear'); + \Artisan::call('route:cache'); + + // print success message + $this->info('The Tabler.io Framework is now updated.'); + $this->newLine(); + $this->line('Please run php artisan migrate before continuing.'); + } else { + // print abort message + $this->error('Update is aborted'); + } + } + + protected function publishAssets() + { + $this->callSilent('vendor:publish', ['--tag' => 'fortify-ui-tabler-resources', '--force' => true]); + } +} diff --git a/src/FortifyUITablerServiceProvider.php b/src/FortifyUITablerServiceProvider.php index da6c077..b005da4 100644 --- a/src/FortifyUITablerServiceProvider.php +++ b/src/FortifyUITablerServiceProvider.php @@ -4,6 +4,8 @@ use Illuminate\Support\ServiceProvider; use Proxeuse\FortifyUITabler\Commands\FortifyUITablerCommand; +use Proxeuse\FortifyUITabler\Commands\FortifyUITablerUpdateCommand; + class FortifyUITablerServiceProvider extends ServiceProvider { @@ -25,6 +27,7 @@ public function boot() $this->commands([ FortifyUITablerCommand::class, + FortifyUITablerUpdateCommand::class, ]); } }