public function sellerStore() { $select = User::where('fbId', '=', $_SESSION['userFbID'])->get(); $seller = new Seller(); foreach ($select as $selects) { $name = $selects['name']; $fbId = $selects['fbId']; $email = $selects['email']; $image = $selects['image']; } $seller->name = $name; $seller->fbId = $fbId; $seller->email = $email; //$seller->image = $image; $findUsers = Seller::all(); $count = 0; foreach ($findUsers as $findUser) { if ($findUser['fbId'] == $_SESSION['userFbID']) { $count = +1; } } if ($count == 0) { $seller->save(); } return Redirect::to('homeSeller'); }
/** * Save Seller * * @param Seller $seller * @throws DaoException */ public function saveSeller(Seller $seller) { try { $seller->save(); } catch (Exception $e) { throw new DaoException($e->getMessage(), $e->getCode(), $e); } }