protected function getWishlistItem($wishlist_id, $item_id) { $item = WishlistItem::where('id', '=', $item_id)->where('wishlist_id', '=', $wishlist_id)->get()->first(); if (!$item) { app()->abort(404, 'Page not found'); } return $item; }
/** * Run the database seeds. * * @return void */ public function run() { WishlistItem::create(['wishlist_id' => 1, 'name' => 'Socks!', 'url' => 'http://www.sockdreams.com', 'cost' => 10000]); }