Merge pull request #2891 from EnesSacid-Buker/master
The issue of getting media from different disks
This commit is contained in:
commit
dc2ca953dd
@ -11,7 +11,6 @@ use App\Abstracts\View\Component;
|
|||||||
use Illuminate\Support\Facades\Log;
|
use Illuminate\Support\Facades\Log;
|
||||||
use Illuminate\Support\Facades\URL;
|
use Illuminate\Support\Facades\URL;
|
||||||
use Illuminate\Support\Facades\File;
|
use Illuminate\Support\Facades\File;
|
||||||
use Illuminate\Support\Facades\Storage;
|
|
||||||
use Illuminate\Support\Str;
|
use Illuminate\Support\Str;
|
||||||
use Intervention\Image\Exception\NotReadableException;
|
use Intervention\Image\Exception\NotReadableException;
|
||||||
use Image;
|
use Image;
|
||||||
@ -928,7 +927,7 @@ abstract class Show extends Component
|
|||||||
if (! empty($media)) {
|
if (! empty($media)) {
|
||||||
$path = $media->getDiskPath();
|
$path = $media->getDiskPath();
|
||||||
|
|
||||||
if (Storage::missing($path)) {
|
if (! $media->fileExists()) {
|
||||||
return $logo;
|
return $logo;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -941,7 +940,7 @@ abstract class Show extends Component
|
|||||||
$height = setting('invoice.logo_size_height');
|
$height = setting('invoice.logo_size_height');
|
||||||
|
|
||||||
if ($media) {
|
if ($media) {
|
||||||
$image->make(Storage::get($path))->resize($width, $height)->encode();
|
$image->make($media->contents())->resize($width, $height)->encode();
|
||||||
} else {
|
} else {
|
||||||
$image->make($path)->resize($width, $height)->encode();
|
$image->make($path)->resize($width, $height)->encode();
|
||||||
}
|
}
|
||||||
|
@ -10,7 +10,6 @@ use App\Traits\Tailwind;
|
|||||||
use App\Traits\ViewComponents;
|
use App\Traits\ViewComponents;
|
||||||
use Illuminate\Support\Facades\Log;
|
use Illuminate\Support\Facades\Log;
|
||||||
use Illuminate\Support\Facades\File;
|
use Illuminate\Support\Facades\File;
|
||||||
use Illuminate\Support\Facades\Storage;
|
|
||||||
use Illuminate\Support\Str;
|
use Illuminate\Support\Str;
|
||||||
use Intervention\Image\Exception\NotReadableException;
|
use Intervention\Image\Exception\NotReadableException;
|
||||||
use Image;
|
use Image;
|
||||||
@ -228,7 +227,7 @@ abstract class Template extends Component
|
|||||||
if (! empty($media)) {
|
if (! empty($media)) {
|
||||||
$path = $media->getDiskPath();
|
$path = $media->getDiskPath();
|
||||||
|
|
||||||
if (Storage::missing($path)) {
|
if (! $media->fileExists()) {
|
||||||
return $logo;
|
return $logo;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -241,7 +240,7 @@ abstract class Template extends Component
|
|||||||
$height = setting('invoice.logo_size_height');
|
$height = setting('invoice.logo_size_height');
|
||||||
|
|
||||||
if ($media) {
|
if ($media) {
|
||||||
$image->make(Storage::get($path))->resize($width, $height)->encode();
|
$image->make($media->contents())->resize($width, $height)->encode();
|
||||||
} else {
|
} else {
|
||||||
$image->make($path)->resize($width, $height)->encode();
|
$image->make($path)->resize($width, $height)->encode();
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,6 @@ use App\Traits\Transactions;
|
|||||||
use App\Utilities\Modules;
|
use App\Utilities\Modules;
|
||||||
use Illuminate\Support\Facades\File;
|
use Illuminate\Support\Facades\File;
|
||||||
use Illuminate\Support\Facades\Log;
|
use Illuminate\Support\Facades\Log;
|
||||||
use Illuminate\Support\Facades\Storage;
|
|
||||||
use Illuminate\Support\Facades\URL;
|
use Illuminate\Support\Facades\URL;
|
||||||
use Illuminate\Support\Str;
|
use Illuminate\Support\Str;
|
||||||
use Intervention\Image\Facades\Image;
|
use Intervention\Image\Facades\Image;
|
||||||
@ -501,7 +500,7 @@ abstract class Show extends Component
|
|||||||
if (! empty($media)) {
|
if (! empty($media)) {
|
||||||
$path = $media->getDiskPath();
|
$path = $media->getDiskPath();
|
||||||
|
|
||||||
if (Storage::missing($path)) {
|
if (! $media->fileExists()) {
|
||||||
return $logo;
|
return $logo;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -514,7 +513,7 @@ abstract class Show extends Component
|
|||||||
$height = setting('invoice.logo_size_height');
|
$height = setting('invoice.logo_size_height');
|
||||||
|
|
||||||
if ($media) {
|
if ($media) {
|
||||||
$image->make(Storage::get($path))->resize($width, $height)->encode();
|
$image->make($media->contents())->resize($width, $height)->encode();
|
||||||
} else {
|
} else {
|
||||||
$image->make($path)->resize($width, $height)->encode();
|
$image->make($path)->resize($width, $height)->encode();
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,6 @@ use App\Traits\Transactions;
|
|||||||
use App\Utilities\Modules;
|
use App\Utilities\Modules;
|
||||||
use Illuminate\Support\Facades\File;
|
use Illuminate\Support\Facades\File;
|
||||||
use Illuminate\Support\Facades\Log;
|
use Illuminate\Support\Facades\Log;
|
||||||
use Illuminate\Support\Facades\Storage;
|
|
||||||
use Illuminate\Support\Str;
|
use Illuminate\Support\Str;
|
||||||
use Intervention\Image\Facades\Image;
|
use Intervention\Image\Facades\Image;
|
||||||
use Intervention\Image\Exception\NotReadableException;
|
use Intervention\Image\Exception\NotReadableException;
|
||||||
@ -277,7 +276,7 @@ abstract class Template extends Component
|
|||||||
if (!empty($media)) {
|
if (!empty($media)) {
|
||||||
$path = $media->getDiskPath();
|
$path = $media->getDiskPath();
|
||||||
|
|
||||||
if (Storage::missing($path)) {
|
if (! $media->fileExists()) {
|
||||||
return $logo;
|
return $logo;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -290,7 +289,7 @@ abstract class Template extends Component
|
|||||||
$height = setting('invoice.logo_size_height');
|
$height = setting('invoice.logo_size_height');
|
||||||
|
|
||||||
if ($media) {
|
if ($media) {
|
||||||
$image->make(Storage::get($path))->resize($width, $height)->encode();
|
$image->make($media->contents())->resize($width, $height)->encode();
|
||||||
} else {
|
} else {
|
||||||
$image->make($path)->resize($width, $height)->encode();
|
$image->make($path)->resize($width, $height)->encode();
|
||||||
}
|
}
|
||||||
|
@ -4,7 +4,6 @@ namespace App\Traits;
|
|||||||
|
|
||||||
use App\Models\Common\Media as MediaModel;
|
use App\Models\Common\Media as MediaModel;
|
||||||
use App\Utilities\Date;
|
use App\Utilities\Date;
|
||||||
use Illuminate\Support\Facades\Storage;
|
|
||||||
use Illuminate\Support\Str;
|
use Illuminate\Support\Str;
|
||||||
use MediaUploader;
|
use MediaUploader;
|
||||||
|
|
||||||
@ -112,7 +111,7 @@ trait Uploads
|
|||||||
|
|
||||||
$path = $media->getDiskPath();
|
$path = $media->getDiskPath();
|
||||||
|
|
||||||
if (Storage::missing($path)) {
|
if (! $media->fileExists()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user