|
1
|
|
|
<?php namespace App\Http\Controllers\Backend; |
|
2
|
|
|
|
|
3
|
|
|
use App\Http\Controllers\Controller; |
|
4
|
|
|
use Hideyo\Ecommerce\Framework\Services\TaxRate\TaxRateFacade as TaxRateService; |
|
5
|
|
|
|
|
6
|
|
|
use Illuminate\Http\Request; |
|
7
|
|
|
use Notification; |
|
8
|
|
|
use Form; |
|
9
|
|
|
use Datatables; |
|
|
|
|
|
|
10
|
|
|
|
|
11
|
|
|
class TaxRateController extends Controller |
|
12
|
|
|
{ |
|
13
|
|
|
public function index(Request $request) |
|
14
|
|
|
{ |
|
15
|
|
|
if ($request->wantsJson()) { |
|
16
|
|
|
$query = TaxRateService::getModel()->where('shop_id', '=', auth('hideyobackend')->user()->selected_shop_id); |
|
|
|
|
|
|
17
|
|
|
$datatables = Datatables::of($query)->addColumn('action', function ($query) { |
|
18
|
|
|
$deleteLink = Form::deleteajax(url()->route('tax-rate.destroy', $query->id), 'Delete', '', array('class'=>'btn btn-sm btn-danger'), $query->title); |
|
19
|
|
|
$links = '<a href="'.url()->route('tax-rate.edit', $query->id).'" class="btn btn-sm btn-success"><i class="fi-pencil"></i>Edit</a> '.$deleteLink; |
|
20
|
|
|
return $links; |
|
21
|
|
|
}); |
|
22
|
|
|
|
|
23
|
|
|
return $datatables->make(true); |
|
24
|
|
|
} |
|
25
|
|
|
|
|
26
|
|
|
return view('backend.tax_rate.index')->with('taxRate', TaxRateService::selectAll()); |
|
27
|
|
|
} |
|
28
|
|
|
|
|
29
|
|
|
public function create() |
|
30
|
|
|
{ |
|
31
|
|
|
return view('backend.tax_rate.create')->with(array()); |
|
32
|
|
|
} |
|
33
|
|
|
|
|
34
|
|
|
public function store(Request $request) |
|
35
|
|
|
{ |
|
36
|
|
|
$result = TaxRateService::create($request->all()); |
|
37
|
|
|
return TaxRateService::notificationRedirect('tax-rate.index', $result, 'The tax rate was inserted.'); |
|
38
|
|
|
} |
|
39
|
|
|
|
|
40
|
|
|
public function edit($taxRateId) |
|
41
|
|
|
{ |
|
42
|
|
|
return view('backend.tax_rate.edit')->with(array('taxRate' => TaxRateService::find($taxRateId))); |
|
43
|
|
|
} |
|
44
|
|
|
|
|
45
|
|
|
public function update(Request $request, $taxRateId) |
|
46
|
|
|
{ |
|
47
|
|
|
$result = TaxRateService::updateById($request->all(), $taxRateId); |
|
48
|
|
|
return TaxRateService::notificationRedirect('tax-rate.index', $result, 'The tax rate was updated.'); |
|
49
|
|
|
} |
|
50
|
|
|
|
|
51
|
|
|
public function destroy($taxRateId) |
|
52
|
|
|
{ |
|
53
|
|
|
$result = TaxRateService::destroy($taxRateId); |
|
54
|
|
|
if ($result) { |
|
55
|
|
|
Notification::error('The tax rate was deleted.'); |
|
56
|
|
|
return redirect()->route('tax-rate.index'); |
|
57
|
|
|
} |
|
58
|
|
|
} |
|
59
|
|
|
} |
|
60
|
|
|
|
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths