/** * Show the form for editing the specified series. * * @param int $id * @return Response */ public function edit($id) { $series = Series::find($id); $selected_casts = array_pluck($series->xcast, 'id'); $xcasts = Xcast::orderBy('title')->get()->toArray(); $grouped_casts = array_chunk($xcasts, ceil(count($xcasts) / 3)); return View::make('admin.series.edit', compact('series', 'grouped_casts', 'selected_casts')); }
public function index() { $xcasts = Xcast::all()->sortByDesc('updated_at')->take(10); $top3 = Xcast::orderBy(DB::raw('RAND()'))->take(3)->get(); return View::make('site.home', compact('xcasts', 'top3')); }