25 lines
421 B
PHP
25 lines
421 B
PHP
<?php
|
|
|
|
namespace App\Helpers;
|
|
|
|
use Illuminate\Support\Facades\Storage;
|
|
|
|
class StorageHelper
|
|
{
|
|
/**
|
|
* Get the URL for a file stored on the public disk
|
|
*
|
|
* @param string|null $path
|
|
* @return string|null
|
|
*/
|
|
public static function url(?string $path): ?string
|
|
{
|
|
if (!$path) {
|
|
return null;
|
|
}
|
|
|
|
return Storage::disk('public')->url($path);
|
|
}
|
|
}
|
|
|