FEATURE: add command for displaying info about currently set template

This commit is contained in:
Michal Kváček
2017-02-23 18:23:59 +01:00
parent 26854b7207
commit 93fc9316a4
3 changed files with 45 additions and 2 deletions
@@ -12,7 +12,6 @@ class PublishTemplateResources extends Command
* @var string
*/
protected $signature = 'template:publish';
/**
* The console command description.
*
@@ -27,6 +26,7 @@ class PublishTemplateResources extends Command
*/
public function handle()
{
$this->call('cache:clear');
$this->call('vendor:publish', ['--tag' => 'module-views', '--force' => true]);
$this->call('vendor:publish', ['--tag' => 'public-assets', '--force' => true]);
}
+41
View File
@@ -0,0 +1,41 @@
<?php
namespace App\Console\Commands;
use App\CMS\Helpers\CurrentTemplate;
use Illuminate\Console\Command;
class TemplateInfo extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'template:info';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Show details about currently set template';
/**
* Execute the console command.
*
* @return mixed
*/
public function handle()
{
$template = CurrentTemplate::get();
if (is_null($template)) {
$this->error('No template set.');
return;
}
$this->line($template->name);
$this->line($template->handler);
}
}
+3 -1
View File
@@ -3,6 +3,7 @@
namespace App\Console;
use App\Console\Commands\PublishTemplateResources;
use App\Console\Commands\TemplateInfo;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
@@ -23,7 +24,8 @@ class Kernel extends ConsoleKernel
Commands\InitDatabaseSchema::class,
Commands\SetTemplate::class,
Commands\AddLanguage::class,
PublishTemplateResources::class
PublishTemplateResources::class,
TemplateInfo::class
];
/**