我的控制器是:
public function index()
{
$details= Food::all();
return view('details.index', compact('details'));
}
public function show($Food_id)
{
$detail=Food::findOrFail($Food_id);
return view('details.show', compact('detail'));
}
我的index.blade.php是:
<h1>Details</h1>
<hr/>
@foreach($details as $detail)
<detail>
<h2>
<a href="/details/{{$detail->Food_id}}">{{$detail->FoodName}}
</a>
</h2>
</detail>
@endforeach
我的show.blade.php是:
<h1 align="center">{{$detail -> FoodName}}</h1>
<detail>
<h3><p>Name:</h3><h4>{{$detail->FoodName}}</h4></p>
我想显示存储在公共/上传文件夹中的食物图像。如何获取图像以显示它们。
答案 0 :(得分:0)
假设每个cd somecurrentworkingdirectory
for branch in `git branch --no-merged master` ; do
echo Creating $branch
git clone git://source/repos/xyz /whereveryourwebserveris/branches/$branch -b $branch
... do more stuff to get it working on your webserver ...
done
对象都拥有food
属性,您可以使用Laravel的image
帮助程序显示上传的图像。
asset