我想顯示指定ID的所有圖像。Laravel - 如何顯示具有公用文件夾中指定名稱的圖像?
例如:我只想在下劃線之前顯示具有相同ID的所有圖像。
我該怎麼做? 我有這個,
Route::get('images/{filename}', function ($filename)
{
$path = public_path('uploads') . '/' . $filename;
$file = File::get($path);
$type = File::mimeType($path);
$response = Response::make($file, 200);
$response->header("Content-Type", $type);
return $response;
});
但我想改變,而不是文件名,我想一個ID,我想告訴所有的圖像與ID
注啓動:對不起,是新來的!
共享一些代碼,你已經嘗試到現在爲止 –
http://stackoverflow.com/help/how-to-ask http://stackoverflow.com/help/在主題上 - 請看看id並編輯你的問題。正如Neetin所說,告訴我們你到目前爲止所嘗試過的。 Stackoverflow在這裏可以幫助你,而不是爲你編寫代碼。 – Twinfriends