maestriam /
samurai
| 1 | <?php |
||
| 2 | |||
| 3 | namespace Maestriam\Samurai\Console; |
||
| 4 | |||
| 5 | use Exception; |
||
| 6 | use Maestriam\Samurai\Support\Samurai; |
||
| 7 | |||
| 8 | class UseThemeCommand extends BaseCommand |
||
| 9 | { |
||
| 10 | /** |
||
| 11 | * {@inheritDoc} |
||
| 12 | */ |
||
| 13 | protected $signature = 'samurai:use {theme}'; |
||
| 14 | |||
| 15 | /** |
||
| 16 | * {@inheritDoc} |
||
| 17 | */ |
||
| 18 | protected $description = 'Refresh cache and view in Laravel Project.'; |
||
| 19 | |||
| 20 | /** |
||
| 21 | * {@inheritDoc} |
||
| 22 | */ |
||
| 23 | protected string $successMessage = 'Theme [%s] is current and ready to use.'; |
||
| 24 | |||
| 25 | /** |
||
| 26 | * {@inheritDoc} |
||
| 27 | */ |
||
| 28 | protected string $errorMessage = 'Error to refresh project: %s'; |
||
| 29 | |||
| 30 | /** |
||
| 31 | * Executa o comando para publicação de assets do tema |
||
| 32 | * |
||
| 33 | * @return void |
||
| 34 | */ |
||
| 35 | public function handle() |
||
| 36 | { |
||
| 37 | try { |
||
| 38 | |||
| 39 | $name = (string) $this->argument('theme'); |
||
| 40 | |||
| 41 | Samurai::theme($name)->use()->publish(); |
||
|
0 ignored issues
–
show
Bug
introduced
by
Loading history...
|
|||
| 42 | |||
| 43 | $this->clean(); |
||
| 44 | |||
| 45 | return $this->success($name); |
||
|
0 ignored issues
–
show
|
|||
| 46 | |||
| 47 | } catch (Exception $e) { |
||
| 48 | return $this->failure($e); |
||
|
0 ignored issues
–
show
|
|||
| 49 | } |
||
| 50 | } |
||
| 51 | } |
||
| 52 |