我想显示指定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