Changeset View
Changeset View
Standalone View
Standalone View
src/app/Console/Development/TemplateRender.php
<?php | <?php | ||||
namespace App\Console\Development; | namespace App\Console\Development; | ||||
use Illuminate\Console\Command; | use Illuminate\Console\Command; | ||||
class TemplateRender extends Command | class TemplateRender extends Command | ||||
{ | { | ||||
/** | /** | ||||
* The name and signature of the console command. | * The name and signature of the console command. | ||||
* | * | ||||
* @var string | * @var string | ||||
*/ | */ | ||||
protected $signature = 'template:render {template} {--html} {--pdf}'; | protected $signature = 'template:render {template} {--html} {--text} {--pdf}'; | ||||
/** | /** | ||||
* The console command description. | * The console command description. | ||||
* | * | ||||
* @var string | * @var string | ||||
*/ | */ | ||||
protected $description = "Render a email template."; | protected $description = "Render a email template."; | ||||
Show All 24 Lines | public function handle() | ||||
} | } | ||||
return 1; | return 1; | ||||
} | } | ||||
$mode = 'html'; | $mode = 'html'; | ||||
if (!empty($this->option('pdf'))) { | if (!empty($this->option('pdf'))) { | ||||
$mode = 'pdf'; | $mode = 'pdf'; | ||||
} elseif (!empty($this->option('text'))) { | |||||
$mode = 'text'; | |||||
} | } | ||||
echo $class::fakeRender($mode); | echo $class::fakeRender($mode); | ||||
} | } | ||||
} | } |