예제 #1
0
 private function searchBt($query, $area)
 {
     $bts = BottleTree::where('area', '=', $area)->where(function ($select) use($query) {
         $select->where('nameNormal', 'LIKE', "%" . $query . "%")->orWhere('nameScience', 'LIKE', "%" . $query . "%")->orWhere('code', 'LIKE', "%" . $query . "%");
     })->get();
     $result = array("bt" => $bts, "post" => array(), "keyword" => $query);
     return view('search.show', compact('result'));
 }
예제 #2
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function destroy($id)
 {
     $bt = BottleTree::find($id);
     $bt->delete();
     return redirect()->route('bt.index');
 }