/** * Display a listing of xcasts * * @return Response */ public function index() { $search = Request::get('q'); $xcasts = $search ? Xcast::search($search) : Xcast::latest('updated_at'); if (!Entrust::can('manage_premium_casts') && !Entrust::can('delete_casts')) { $xcasts = $xcasts->onlyFree(); } $xcasts = $xcasts->paginate(8); return View::make('admin.xcasts.index', compact('xcasts')); }
public function whatisnew() { $whatisnew = []; $xcasts = Xcast::latest('updated_at')->take(16)->remember(10)->get(); // dd(\DB::getQueryLog()); $xcasts->each(function ($cast) use(&$whatisnew) { $whatisnew[$cast->updated_at->toFormattedDateString()][] = $cast; }); return View::make('site.whatisnew', compact('whatisnew')); }