Exemplo n.º 1
0
 public function postToggleAvailability()
 {
     $product = Product::find(Input::get('id'));
     if ($product) {
         $product->availability = Input::get('availability');
         $product->save();
         return Redirect::to('admin/products/index')->with('message', 'Product Updated');
     }
     return Redirect::to('admin/products/index')->with('message', 'Invalid Product');
 }
Exemplo n.º 2
0
 public function getSearch()
 {
     $keyword = Input::get('keyword');
     return View::make('store.search')->with('products', Product::where('title', 'LIKE', '%' . $keyword . '%')->get())->with('keyword', $keyword);
 }