public function postMyWishList() { if (Request::ajax()) { $id = Input::get('id'); $wish = Wish::where('item_id', '=', $id)->where('deleted', '=', 0)->count(); if ($wish > 0) { return Response::json(array('type' => 'warning')); } $wish = new Wish(); $wish->item_id = $id; $wish->user_id = Auth::user()->id; if ($wish->save()) { return Response::json(array('type' => 'success')); } else { return Response::json(array('type' => 'danger')); } } }