add error message to checkout

This commit is contained in:
Edward Yang 2022-08-19 16:35:39 +08:00
parent a610c9231f
commit 2d104a0f2c
2 changed files with 3 additions and 1 deletions

View File

@ -23,7 +23,7 @@ class CheckoutController extends Controller
$data = (new CheckoutService)->checkoutData();
return view('checkout', $data);
} catch (\Exception $e) {
return redirect(shop_route('carts.index'));
return redirect(shop_route('carts.index'))->withErrors(['error' => $e->getMessage()]);
}
}

View File

@ -17,6 +17,8 @@
<div class="col-12 col-md-9">@include('shared.steps', ['steps' => 1])</div>
</div>
@dump($errors)
<div class="row mt-5" v-if="products.length">
<div class="col-12 col-md-9">
<div class="cart-products-wrap table-responsive">