Guest User

Untitled

a guest
Jan 22nd, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. <form action="{{ route(shop.find) }}">
  2. <select class="form-control" name="customers1" id="customers1">
  3. @foreach ($customers as $key => $value)
  4. <option value="{{ $key }}">{{ $value }}</option>
  5. @endforeach
  6. </select>
  7. <select class="form-control" name="type1" id="type1">
  8. @foreach ($types as $key => $value)
  9. <option value="{{ $key }}">{{ $value }}</option>
  10. @endforeach
  11. </select>
  12. </form>
  13.  
  14. public function find(Request $request){
  15. $customers = DB::table("tbl_customers")->pluck('name','id')->where('name', '=', $request->name);
  16. //This where command is absolutely wrong. I need the right ways to do it.
  17. $types = DB::table("tbl_types")->pluck('race','raceid')->where('race', '=', $request->race);
  18. return view('shop.find',compact('customers', 'types'));}
Add Comment
Please, Sign In to add comment