Shipping Tax Card

This commit is contained in:
Kevin Adametz 2020-07-01 16:13:38 +02:00
parent da08e9ff37
commit eb55b01b0d
13 changed files with 86 additions and 81 deletions

View file

@ -59,8 +59,8 @@ class ShippingController extends Controller
$shipping = false;
$data = Request::all();
if($data['action'] == 'shipping'){
if ($data['id'] == "new") {
if($data['action'] === 'shipping'){
if ($data['id'] === "new") {
$shipping = new Shipping();
$rules = array('name' => 'required');
} else {
@ -79,7 +79,7 @@ class ShippingController extends Controller
$shipping->save();
}
if($data['action'] == 'price'){
if($data['action'] === 'price'){
$shipping = Shipping::findOrFail($data['shipping_id']);
$rules = array('price' => 'required');
$ret = ['value' => $shipping];
@ -87,7 +87,7 @@ class ShippingController extends Controller
if ($validator->fails()) {
return view('admin.shipping.edit', $ret)->withErrors($validator);
}
if ($data['id'] == "new") {
if ($data['id'] === "new") {
$price = ShippingPrice::create($data);
} else {
$price = ShippingPrice::findOrFail($data['id']);
@ -99,7 +99,7 @@ class ShippingController extends Controller
}
}
if($data['action'] == 'country'){
if($data['action'] === 'country'){
$shipping = Shipping::findOrFail($data['shipping_id']);
foreach($data['country_ids'] as $country_id){
if(ShippingCountry::where('country_id', $country_id)->count() == 0){