Skip to content

Commit

Permalink
✨ Updater
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
roelreijneveld committed Dec 27, 2020
1 parent eba37bf commit ddd5aec
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 0 deletions.
46 changes: 46 additions & 0 deletions src/Commands/FortifyUITablerUpdateCommand.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<?php

namespace Proxeuse\FortifyUITabler\Commands;

use Illuminate\Console\Command;
use Illuminate\Support\Facades\Schema;

class FortifyUITablerUpdateCommand extends Command
{
public $signature = 'fortify-ui:tabler-update';

public $description = 'Update views, resources and routes for the Tabler.io framework.';

public function handle()
{
// confirm the installation
if ($this->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]);
}
}
3 changes: 3 additions & 0 deletions src/FortifyUITablerServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

use Illuminate\Support\ServiceProvider;
use Proxeuse\FortifyUITabler\Commands\FortifyUITablerCommand;
use Proxeuse\FortifyUITabler\Commands\FortifyUITablerUpdateCommand;


class FortifyUITablerServiceProvider extends ServiceProvider
{
Expand All @@ -25,6 +27,7 @@ public function boot()

$this->commands([
FortifyUITablerCommand::class,
FortifyUITablerUpdateCommand::class,
]);
}
}
Expand Down

0 comments on commit ddd5aec

Please sign in to comment.