これを実現する最も簡単な方法は、新しいディスクを追加することです。このようにして、既存のファイルや URL に影響を与えることなく、新しいパターンを画像に適用でき、その他にも多くの利点があります。
ステップ1
ディスクをconfig/filesystems.phpに追加します。
'images' => [
        'driver' => 'local',
        'root' => storage_path('app/public/images'),
        'url' => env('APP_URL') . '/images',
        'visibility' => 'public',
 ],
コントローラーから新しいディスクにファイルのアップロードを保存する方法の例を次に示します。
// storeAs: path, filename, disk
$request->file('image')->storeAs('/', 'x.jpg', 'images')
そして、これは次のような画像へのリンクを生成する方法ですhttp://example.com/images/x.jpg:
Storage::disk('images')->url('x.jpg')
ステップ2
新しいパスからファイルを提供するための 3 つの異なるオプションを次に示します (選択する必要があるのは 1 つだけです)。
オプション1
パブリック ディレクトリにシンボリック リンクを作成します。
ln -s /var/www/example.com/storage/app/public/images /var/www/example.com/public/images
これは、Laravel がデフォルトの公開ディスク ( /storageURL) に使用するのと同じ方法です。
Laravel 7以降、config/filesystems.php追加のシンボリックリンクを管理するために変更できます:
    /*
    |--------------------------------------------------------------------------
    | Symbolic Links
    |--------------------------------------------------------------------------
    |
    | Here you may configure the symbolic links that will be created when the
    | `storage:link` Artisan command is executed. The array keys should be
    | the locations of the links and the values should be their targets.
    |
    */
    'links' => [
        public_path('storage') => storage_path('app/public'),
        public_path('images')  => storage_path('app/public/images'),
    ],
オプション 2
画像を提供するために、Laravel アプリケーションでルートを作成します。
Route::get('images/{file}', function ($file) {
    return Storage::disk('images')->response($file);
    // or to trigger downloads:
    // return Storage::disk('images')->download($file);
});
このオプションの欠点は、オプション 1 および 3 のように Web サーバーによって処理されるのではなく、PHP プロセスを使用して各画像を提供することです。
オプション 3
Web サーバーで書き換えルールを作成します。
nginx では、次のようになります。
location /images/ {
    root /var/www/example.com/storage/app/public/;
}
Apache では、エイリアスを使用できます。
Alias "/images" "/var/www/example.com/storage/app/public/images"