Merge pull request #255 from imanghafoori1/master
Update TaxCategoryController.php -> PR #255 accepted.
This commit is contained in:
commit
f546cfce30
|
|
@ -145,20 +145,21 @@ class TaxCategoryController extends Controller
|
|||
|
||||
$data = request()->input();
|
||||
|
||||
if($taxCategory = $this->taxCategory->update($data, $id)) {
|
||||
$taxRates = $data['taxrates'];
|
||||
$taxCategory = $this->taxCategory->update($data, $id);
|
||||
|
||||
//attach the categories in the tax map table
|
||||
$this->taxCategory->attachOrDetach($taxCategory, $taxRates);
|
||||
|
||||
session()->flash('success', trans('admin::app.settings.tax-categories.update-success'));
|
||||
|
||||
return redirect()->route($this->_config['redirect']);
|
||||
} else {
|
||||
if(!$taxCategory) {
|
||||
session()->flash('error', trans('admin::app.settings.tax-categories.update-error'));
|
||||
|
||||
return redirect()->back();
|
||||
}
|
||||
|
||||
$taxRates = $data['taxrates'];
|
||||
|
||||
//attach the categories in the tax map table
|
||||
$this->taxCategory->attachOrDetach($taxCategory, $taxRates);
|
||||
|
||||
session()->flash('success', trans('admin::app.settings.tax-categories.update-success'));
|
||||
|
||||
return redirect()->route($this->_config['redirect']);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in New Issue