53 lines
1.0 KiB
PHP
53 lines
1.0 KiB
PHP
<?php
|
|
|
|
namespace App\Console\Commands;
|
|
|
|
use Illuminate\Console\Command;
|
|
use Illuminate\Support\Facades\Storage;
|
|
|
|
class Thumbnail extends Command
|
|
{
|
|
/**
|
|
* The name and signature of the console command.
|
|
*
|
|
* @var string
|
|
*/
|
|
protected $signature = 'thumbnail:make';
|
|
|
|
/**
|
|
* The console command description.
|
|
*
|
|
* @var string
|
|
*/
|
|
protected $description = 'Make thumbnails of all image files';
|
|
|
|
/**
|
|
* Create a new command instance.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function __construct()
|
|
{
|
|
parent::__construct();
|
|
}
|
|
|
|
/**
|
|
* Execute the console command.
|
|
*
|
|
* @return mixed
|
|
*/
|
|
public function handle()
|
|
{
|
|
$dir = public_path().'/'.config('app.image.dir').'/backup';
|
|
$thumb_dir = config('app.image.thumb_dir');
|
|
$w = config('app.image.thumb_width');
|
|
$h = config('app.image.thumb_height');
|
|
|
|
$files = Storage::allFiles(public_path()."/".$dir);
|
|
|
|
foreach ($files as $file) {
|
|
echo $file;
|
|
}
|
|
}
|
|
}
|