public function results(Request $request) { $services = Service::name($request->get('query'))->orderBy('created_at', 'DESC')->get(); $materials = Material::name($request->get('query'))->orderBy('created_at', 'DESC')->get(); $results = $materials->merge($services); return view('results')->with('results', $results)->with('title', $request->get('query')); }
public static function filter($name) { return Service::name($name)->orderBy('name', 'ASC')->paginate(10); }