public function postWishlist() { $rules = array('wishlist' => 'min:8|max:2048'); $validator = Validator::make(Input::all(), $rules); if ($validator->fails()) { return Redirect::route('dashboard.edit.wishlist', ['wishlist' => $this->user->wishlist()->get()])->withErrors($validator)->withInput(Input::all()); } else { $wishlist = Wishlist::whereUserId($this->user->id)->first(); if ($wishlist) { $wishlist->wishlist = Input::get('wishlist'); $wishlist->save(); } else { $wishlist = new Wishlist(); $wishlist->wishlist = Input::get('wishlist'); $this->user->wishlist()->save($wishlist); } return Redirect::route('dashboard'); } }