1
0
Fork 0

Adding app/Console/Commands/InstallLogo.php

This commit is contained in:
Henrik Hautakoski 2023-01-29 13:58:50 +01:00
parent 1994f30f9e
commit 3e15982456
2 changed files with 39 additions and 0 deletions

View file

@ -0,0 +1,37 @@
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Storage;
use Illuminate\Support\Str;
class InstallLogo extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'install:logo {name}';
/**
* The console command description.
*
* @var string
*/
protected $description = 'install logo';
/**
* Execute the console command.
*
* @return int
*/
public function handle()
{
$filename = $this->argument('name') . '.png';
Storage::disk('resources')->copy('logos/' . $filename, 'images/logo.png');
}
}

View file

@ -13,6 +13,8 @@ class Kernel extends ConsoleKernel
* @var array
*/
protected $commands = [
Commands\InstallLogo::class,
Commands\CardImport::class,
Commands\CardExport::class,
];