【发布时间】:2017-07-20 14:20:36
【问题描述】:
我想显示所有指定 id 的图片。
例如:我只想在下划线之前显示所有具有相同 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 开头的图像
注意:对不起,新来的!
【问题讨论】:
-
分享一些代码,你到目前为止所尝试的
-
stackoverflow.com/help/how-to-ask stackoverflow.com/help/on-topic - 请查看 id 并编辑您的问题。正如 Neetin 所说,向我们展示您迄今为止所做的尝试。 Stackoverflow 是为您提供帮助,而不是为您编写代码。
标签: php image laravel directory