FEATURE: add command for displaying info about currently set template
This commit is contained in:
@@ -12,7 +12,6 @@ class PublishTemplateResources extends Command
|
|||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
protected $signature = 'template:publish';
|
protected $signature = 'template:publish';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The console command description.
|
* The console command description.
|
||||||
*
|
*
|
||||||
@@ -27,6 +26,7 @@ class PublishTemplateResources extends Command
|
|||||||
*/
|
*/
|
||||||
public function handle()
|
public function handle()
|
||||||
{
|
{
|
||||||
|
$this->call('cache:clear');
|
||||||
$this->call('vendor:publish', ['--tag' => 'module-views', '--force' => true]);
|
$this->call('vendor:publish', ['--tag' => 'module-views', '--force' => true]);
|
||||||
$this->call('vendor:publish', ['--tag' => 'public-assets', '--force' => true]);
|
$this->call('vendor:publish', ['--tag' => 'public-assets', '--force' => true]);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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,6 +3,7 @@
|
|||||||
namespace App\Console;
|
namespace App\Console;
|
||||||
|
|
||||||
use App\Console\Commands\PublishTemplateResources;
|
use App\Console\Commands\PublishTemplateResources;
|
||||||
|
use App\Console\Commands\TemplateInfo;
|
||||||
use Illuminate\Console\Scheduling\Schedule;
|
use Illuminate\Console\Scheduling\Schedule;
|
||||||
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
|
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
|
||||||
|
|
||||||
@@ -23,7 +24,8 @@ class Kernel extends ConsoleKernel
|
|||||||
Commands\InitDatabaseSchema::class,
|
Commands\InitDatabaseSchema::class,
|
||||||
Commands\SetTemplate::class,
|
Commands\SetTemplate::class,
|
||||||
Commands\AddLanguage::class,
|
Commands\AddLanguage::class,
|
||||||
PublishTemplateResources::class
|
PublishTemplateResources::class,
|
||||||
|
TemplateInfo::class
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user