Merge pull request #2123 from rahulshukla-webkul/development
Issue #2087
This commit is contained in:
commit
956259cc32
|
|
@ -57,27 +57,33 @@ class ResetPasswordController extends Controller
|
|||
*/
|
||||
public function store()
|
||||
{
|
||||
$this->validate(request(), [
|
||||
'token' => 'required',
|
||||
'email' => 'required|email',
|
||||
'password' => 'required|confirmed|min:6',
|
||||
]);
|
||||
|
||||
$response = $this->broker()->reset(
|
||||
request(['email', 'password', 'password_confirmation', 'token']), function ($customer, $password) {
|
||||
$this->resetPassword($customer, $password);
|
||||
}
|
||||
);
|
||||
|
||||
if ($response == Password::PASSWORD_RESET) {
|
||||
return redirect()->route($this->_config['redirect']);
|
||||
}
|
||||
|
||||
return back()
|
||||
->withInput(request(['email']))
|
||||
->withErrors([
|
||||
'email' => trans($response)
|
||||
try {
|
||||
$this->validate(request(), [
|
||||
'token' => 'required',
|
||||
'email' => 'required|email',
|
||||
'password' => 'required|confirmed|min:6',
|
||||
]);
|
||||
|
||||
$response = $this->broker()->reset(
|
||||
request(['email', 'password', 'password_confirmation', 'token']), function ($customer, $password) {
|
||||
$this->resetPassword($customer, $password);
|
||||
}
|
||||
);
|
||||
|
||||
if ($response == Password::PASSWORD_RESET) {
|
||||
return redirect()->route($this->_config['redirect']);
|
||||
}
|
||||
|
||||
return back()
|
||||
->withInput(request(['email']))
|
||||
->withErrors([
|
||||
'email' => trans($response)
|
||||
]);
|
||||
} catch(\Exception $e) {
|
||||
session()->flash('success', trans($e->getMessage()));
|
||||
|
||||
return redirect()->back();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -170,7 +170,7 @@ class WishlistController extends Controller
|
|||
} catch (\Exception $e) {
|
||||
session()->flash('warning', $e->getMessage());
|
||||
|
||||
return redirect()->route('shop.productOrCategory.index', ['slugOrPath' => $wishlistItem->product->url_key]);
|
||||
return redirect()->route('shop.productOrCategory.index', $wishlistItem->product->url_key);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ class CartController extends Controller
|
|||
|
||||
$product = $this->productRepository->find($id);
|
||||
|
||||
return redirect()->route('shop.productOrCategory.index', ['slugOrPath' => $product->url_key]);
|
||||
return redirect()->route('shop.productOrCategory.index', $product->url_key);
|
||||
}
|
||||
|
||||
return redirect()->back();
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ Route::group(['middleware' => ['web', 'locale', 'theme', 'currency']], function
|
|||
Route::post('checkout/cart/coupon', 'Webkul\Shop\Http\Controllers\CartController@applyCoupon')->name('shop.checkout.cart.coupon.apply');
|
||||
|
||||
Route::delete('checkout/cart/coupon', 'Webkul\Shop\Http\Controllers\CartController@removeCoupon')->name('shop.checkout.coupon.remove.coupon');
|
||||
|
||||
|
||||
//Cart Items Add
|
||||
Route::post('checkout/cart/add/{id}', 'Webkul\Shop\Http\Controllers\CartController@add')->defaults('_config', [
|
||||
'redirect' => 'shop.checkout.cart.index'
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ class ForgetPasswordController extends Controller
|
|||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*
|
||||
* @return \Illuminate\View\View
|
||||
* @return \Illuminate\View\View
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
|
|
@ -49,25 +49,31 @@ class ForgetPasswordController extends Controller
|
|||
*/
|
||||
public function store()
|
||||
{
|
||||
$this->validate(request(), [
|
||||
'email' => 'required|email'
|
||||
]);
|
||||
try {
|
||||
$this->validate(request(), [
|
||||
'email' => 'required|email'
|
||||
]);
|
||||
|
||||
$response = $this->broker()->sendResetLink(
|
||||
request(['email'])
|
||||
);
|
||||
|
||||
if ($response == Password::RESET_LINK_SENT) {
|
||||
session()->flash('success', trans($response));
|
||||
|
||||
return back();
|
||||
}
|
||||
|
||||
return back()
|
||||
->withInput(request(['email']))
|
||||
->withErrors(
|
||||
['email' => trans($response)]
|
||||
$response = $this->broker()->sendResetLink(
|
||||
request(['email'])
|
||||
);
|
||||
|
||||
if ($response == Password::RESET_LINK_SENT) {
|
||||
session()->flash('success', trans($response));
|
||||
|
||||
return back();
|
||||
}
|
||||
|
||||
return back()
|
||||
->withInput(request(['email']))
|
||||
->withErrors(
|
||||
['email' => trans($response)]
|
||||
);
|
||||
} catch(\Exception $e) {
|
||||
session()->flash('success', trans($e->getMessage()));
|
||||
|
||||
return redirect()->back();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in New Issue