try and catch in password section and wishlist add remove
This commit is contained in:
parent
956259cc32
commit
2c0b7e4e54
|
|
@ -80,7 +80,7 @@ class ResetPasswordController extends Controller
|
||||||
'email' => trans($response)
|
'email' => trans($response)
|
||||||
]);
|
]);
|
||||||
} catch(\Exception $e) {
|
} catch(\Exception $e) {
|
||||||
session()->flash('success', trans($e->getMessage()));
|
session()->flash('error', trans($e->getMessage()));
|
||||||
|
|
||||||
return redirect()->back();
|
return redirect()->back();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -110,7 +110,11 @@ class WishlistController extends Controller
|
||||||
return redirect()->back();
|
return redirect()->back();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
session()->flash('warning', trans('customer::app.wishlist.already'));
|
$this->wishlistRepository->findOneWhere([
|
||||||
|
'product_id' => $data['product_id']
|
||||||
|
])->delete();
|
||||||
|
|
||||||
|
session()->flash('success', trans('customer::app.wishlist.removed'));
|
||||||
|
|
||||||
return redirect()->back();
|
return redirect()->back();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -1,4 +1,4 @@
|
||||||
{
|
{
|
||||||
"/js/shop.js": "/js/shop.js?id=8fc3af6f1d9024329021",
|
"/js/shop.js": "/js/shop.js?id=8fc3af6f1d9024329021",
|
||||||
"/css/shop.css": "/css/shop.css?id=6ded8c6338e6cf59a094"
|
"/css/shop.css": "/css/shop.css?id=617c680f279cb4a73734"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -202,8 +202,6 @@ input {
|
||||||
}
|
}
|
||||||
|
|
||||||
.add-to-wishlist.already {
|
.add-to-wishlist.already {
|
||||||
pointer-events: none;
|
|
||||||
|
|
||||||
.wishlist-icon {
|
.wishlist-icon {
|
||||||
background-image: url('../images/wishlist-added.svg') !important;
|
background-image: url('../images/wishlist-added.svg') !important;
|
||||||
}
|
}
|
||||||
|
|
@ -1843,7 +1841,7 @@ section.product-detail {
|
||||||
.sample-list {
|
.sample-list {
|
||||||
padding: 15px 0;
|
padding: 15px 0;
|
||||||
border-top: solid 1px rgba(162, 162, 162, 0.2);
|
border-top: solid 1px rgba(162, 162, 162, 0.2);
|
||||||
|
|
||||||
h3 {
|
h3 {
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
margin-top: 0;
|
margin-top: 0;
|
||||||
|
|
@ -1937,7 +1935,7 @@ section.product-detail {
|
||||||
.qty {
|
.qty {
|
||||||
float: right;
|
float: right;
|
||||||
|
|
||||||
.control-group {
|
.control-group {
|
||||||
max-width: initial;
|
max-width: initial;
|
||||||
width: auto;
|
width: auto;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
|
@ -1987,7 +1985,7 @@ section.product-detail {
|
||||||
.control-group {
|
.control-group {
|
||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
color: #5E5E5E;
|
color: #5E5E5E;
|
||||||
|
|
||||||
label {
|
label {
|
||||||
color: #242424;
|
color: #242424;
|
||||||
}
|
}
|
||||||
|
|
@ -2402,7 +2400,7 @@ section.cart {
|
||||||
justify-content: flex-start;
|
justify-content: flex-start;
|
||||||
align-items: flex-start;
|
align-items: flex-start;
|
||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
|
|
||||||
.control-group {
|
.control-group {
|
||||||
font-size: 16px !important;
|
font-size: 16px !important;
|
||||||
margin: 0px;
|
margin: 0px;
|
||||||
|
|
@ -2979,7 +2977,7 @@ section.review {
|
||||||
.product-price {
|
.product-price {
|
||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
word-break: break-all;
|
word-break: break-all;
|
||||||
|
|
||||||
.pro-price {
|
.pro-price {
|
||||||
color: $disc-price;
|
color: $disc-price;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -70,7 +70,7 @@ class ForgetPasswordController extends Controller
|
||||||
['email' => trans($response)]
|
['email' => trans($response)]
|
||||||
);
|
);
|
||||||
} catch(\Exception $e) {
|
} catch(\Exception $e) {
|
||||||
session()->flash('success', trans($e->getMessage()));
|
session()->flash('error', trans($e->getMessage()));
|
||||||
|
|
||||||
return redirect()->back();
|
return redirect()->back();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -57,27 +57,33 @@ class ResetPasswordController extends Controller
|
||||||
*/
|
*/
|
||||||
public function store()
|
public function store()
|
||||||
{
|
{
|
||||||
$this->validate(request(), [
|
try {
|
||||||
'token' => 'required',
|
$this->validate(request(), [
|
||||||
'email' => 'required|email',
|
'token' => 'required',
|
||||||
'password' => 'required|confirmed|min:6',
|
'email' => 'required|email',
|
||||||
]);
|
'password' => 'required|confirmed|min:6',
|
||||||
|
|
||||||
$response = $this->broker()->reset(
|
|
||||||
request(['email', 'password', 'password_confirmation', 'token']), function ($admin, $password) {
|
|
||||||
$this->resetPassword($admin, $password);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
if ($response == Password::PASSWORD_RESET) {
|
|
||||||
return redirect()->route($this->_config['redirect']);
|
|
||||||
}
|
|
||||||
|
|
||||||
return back()
|
|
||||||
->withInput(request(['email']))
|
|
||||||
->withErrors([
|
|
||||||
'email' => trans($response)
|
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
$response = $this->broker()->reset(
|
||||||
|
request(['email', 'password', 'password_confirmation', 'token']), function ($admin, $password) {
|
||||||
|
$this->resetPassword($admin, $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('error', trans($e->getMessage()));
|
||||||
|
|
||||||
|
return redirect()->back();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue