/** * Search for user domains. * @param Request */ public function add(Request $request) { $name = $request->input('name'); $rank = $request->input('rank'); $domain = new domain(); $domain->name = $name; $domain->rank = $rank; try { $domain->save(); $result = "success"; } catch (\Exception $e) { $result = $e->getMessage(); } return view('admin/add', ['result' => $result]); }
/** * Search for user domains. */ public function search(Request $request) { $search = $request->input('domain'); $searchArray = preg_split('/\\r\\n/', $search); $domains = domain::whereIn('name', $searchArray)->get(); return view('user/search', ['domains' => $domains]); }