public function post($slug) { // order by reason: LIMIT without ORDER BY causes // non-deterministic results, depending on // the query execution plan return Writing::selectSingularColumns()->whereSlug($slug)->published()->orderByDate('created')->firstOrFail(); }
/** * Make writings query. * * @return view */ public function writings() { $writings = Writing::selectWritingColumns()->published()->orderByDate('created')->simplePaginate(15); return view('theme.writings', compact('writings')); }