Merge pull request #2123 from rahulshukla-webkul/development

Issue #2087
This commit is contained in:
Jitendra Singh 2020-01-23 11:51:19 +05:30 committed by GitHub
commit 956259cc32
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 53 additions and 41 deletions

View File

@ -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();
}
}
/**

View File

@ -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);
}
}

View File

@ -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();

View File

@ -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'

View File

@ -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();
}
}
/**