示例#1
0
 /**
  * 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]);
 }
示例#2
0
文件: User.php 项目: KNein32/KYYT1115
 /**
  * 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]);
 }