test
This commit is contained in:
@@ -60,12 +60,7 @@ class Child
|
||||
$tempPath = $screen['image']->store('temp', 'public');
|
||||
$thumbPath = $this->image->resize($tempPath, 322, 'screens', true);
|
||||
|
||||
// Get screen size (local or s3)
|
||||
if (env('FILESYSTEM_DISK') == 's3') {
|
||||
$this->size = Storage::disk('s3')->size($path);
|
||||
} else {
|
||||
$this->size = filesize(public_path($path));
|
||||
}
|
||||
$this->size = Storage::size($path);
|
||||
|
||||
Screen::create([
|
||||
'path' => $path,
|
||||
|
||||
@@ -5,6 +5,7 @@ namespace App\Jobs\Dashboard\Product;
|
||||
use App\Http\Requests\Dashboard\Product\Update as Request;
|
||||
use App\Models\Screen;
|
||||
use App\Models\Product;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
|
||||
class Deletes
|
||||
{
|
||||
@@ -29,14 +30,7 @@ class Deletes
|
||||
foreach ($this->request->deletes['screens'] as $screen) {
|
||||
$sc = Screen::where('id', $screen)->first();
|
||||
if (!empty($sc)) {
|
||||
if (is_file($sc->path)) {
|
||||
unlink($sc->path);
|
||||
}
|
||||
|
||||
if (is_file($sc->path_thumb)) {
|
||||
unlink($sc->path_thumb);
|
||||
}
|
||||
|
||||
Storage::delete([$sc->path, $sc->path_thumb]);
|
||||
$sc->delete();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user