feat: add storage_url helper function and update image URL retrieval to use public disk

This commit is contained in:
2025-11-30 08:20:51 -05:00
parent 5f7f2098ec
commit d4c90da807
6 changed files with 47 additions and 6 deletions

View File

@@ -31,3 +31,20 @@ if (!function_exists('hook')) {
return \App\Helpers\EventHelper::renderEvent($event);
}
}
if (!function_exists('storage_url')) {
/**
* Get the URL for a file stored on the public disk
*
* @param string|null $path
* @return string|null
*/
function storage_url(?string $path): ?string
{
if (!$path) {
return null;
}
return \Illuminate\Support\Facades\Storage::disk('public')->url($path);
}
}