0
在控制器:如何獲得分頁中laravel 5
function show($feast_id)
{
$feastMenu = Feast::find($feast_id);
$feastMenu->load('images', 'menu', 'users');
$feastMenu->chef->load('chefMeta');
$feastMenu = $feastMenu->toArray();
return view('feasts.showFeastMenu', compact('feastMenu'));
}
in views
@foreach($feastMenu['menu'] as $k => $menu)
Menu「{{$feastMenu['name']}}」({{count($feastMenu['menu'])}} course meal)
{{$menu['name']}}
@foreach($menu['menu_items'] as $item)
{{$item['name']}}
{{$item['description']}}
@endforeach
@endforeach
如何設置分頁到這個請laravel建議我使用laravel 5.我已經使用關係到控制器,並通過這些toArray
你嘗試過什麼嗎?似乎沒有這樣..無論如何,這裏是一個簡單的谷歌搜索:https://laravel.com/docs/5.0/pagination – Condorcho