Files
gsf/app/Http/Helpers/ImageHelper.php
vedant-chavan 20f55281ef save to codehub
2024-08-09 17:11:41 +05:30

1 line
646 B
PHP

<?php
use Illuminate\Support\Facades\Storage;
use Image as thumbimage;
/**
* Created By : Pradyumn Dwivedi
* Created at : 16 January 2023
* Use : Function for listing image url
*/
if (!function_exists('ListingImageUrl')) {
function ListingImageUrl($type, $imageName)
{
$src = '';
$defaultImagePath = "";
if (!empty($imageName) && file_exists('public/uploads/' . $type . '/' . $imageName)) {
$src = 'public/uploads/' . $type . '/' . $imageName . '?d=' . time();
} else {
//default image path
$src = $defaultImagePath;
}
return url($src);
}
}