/**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function search(Request $request)
 {
     $q = $request->get('q');
     if ($request->has('q')) {
         if (empty($q)) {
             return redirect('search')->with('status', 'Please, insert a search term.');
         } else {
             $shirts = Shirt::where('name', 'LIKE', '%' . $q . '%')->get();
             if (empty($shirts->toArray())) {
                 return redirect('search')->with('status', 'No products were found matching that search term.')->withInput();
             }
         }
         return view('search', compact('shirts'));
     }
     return view('search');
 }
 /**
  * Display the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function show($id)
 {
     $shirt = Shirt::findOrFail($id);
     return view('shirts.shirt', compact('shirt'));
 }