Local Driver Checking

This commit is contained in:
Devansh 2022-02-10 12:09:14 +05:30
parent 805afe63fc
commit 85293ca642
1 changed files with 11 additions and 1 deletions

View File

@ -138,7 +138,7 @@ class ProductImage extends AbstractProduct
*/
private function getCachedImageUrls($path): array
{
if (config('filesystems.default') !== 'public') {
if (! $this->isDriverLocal()) {
return [
'small_image_url' => Storage::url($path),
'medium_image_url' => Storage::url($path),
@ -169,4 +169,14 @@ class ProductImage extends AbstractProduct
'original_image_url' => asset('vendor/webkul/ui/assets/images/product/large-product-placeholder.webp'),
];
}
/**
* Is driver local.
*
* @return bool
*/
private function isDriverLocal(): bool
{
return Storage::getAdapter() instanceof \League\Flysystem\Adapter\Local;
}
}