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
|
||||
*/
|
||||
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]);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user