1
|
|
|
<?php namespace App\Http\Controllers\Backend; |
2
|
|
|
|
3
|
|
|
use App\Http\Controllers\Controller; |
4
|
|
|
use Illuminate\Http\Request; |
5
|
|
|
use Notification; |
6
|
|
|
use Datatables; |
|
|
|
|
7
|
|
|
use Form; |
8
|
|
|
|
9
|
|
|
use Hideyo\Ecommerce\Framework\Services\GeneralSetting\GeneralSettingFacade as GeneralSettingService; |
10
|
|
|
|
11
|
|
|
class GeneralSettingController extends Controller |
12
|
|
|
{ |
13
|
|
|
public function index(Request $request) |
14
|
|
|
{ |
15
|
|
|
if ($request->wantsJson()) { |
16
|
|
|
|
17
|
|
|
$query = GeneralSettingService::getModel()->select( |
18
|
|
|
[ |
19
|
|
|
|
20
|
|
|
'id', |
21
|
|
|
'name', 'value'] |
22
|
|
|
)->where('shop_id', '=', auth('hideyobackend')->user()->selected_shop_id); |
|
|
|
|
23
|
|
|
|
24
|
|
|
$datatables = Datatables::of($query)->addColumn('action', function ($query) { |
25
|
|
|
$deleteLink = Form::deleteajax(url()->route('general-setting.destroy', $query->id), 'Delete', '', array('class'=>'btn btn-sm btn-danger')); |
26
|
|
|
$links = '<a href="'.url()->route('general-setting.edit', $query->id).'" class="btn btn-sm btn-success"><i class="fi-pencil"></i>Edit</a> '.$deleteLink; |
27
|
|
|
return $links; |
28
|
|
|
}); |
29
|
|
|
|
30
|
|
|
return $datatables->make(true); |
31
|
|
|
} |
32
|
|
|
|
33
|
|
|
return view('backend.general-setting.index')->with('generalSetting', GeneralSettingService::selectAll()); |
34
|
|
|
} |
35
|
|
|
|
36
|
|
|
public function create() |
37
|
|
|
{ |
38
|
|
|
return view('backend.general-setting.create')->with(array()); |
39
|
|
|
} |
40
|
|
|
|
41
|
|
|
public function store(Request $request) |
42
|
|
|
{ |
43
|
|
|
$result = GeneralSettingService::create($request->all()); |
44
|
|
|
return GeneralSettingService::notificationRedirect('general-setting.index', $result, 'The general setting was inserted.'); |
45
|
|
|
} |
46
|
|
|
|
47
|
|
|
public function edit($generalSettingId) |
48
|
|
|
{ |
49
|
|
|
return view('backend.general-setting.edit')->with(array('generalSetting' => GeneralSettingService::find($generalSettingId))); |
50
|
|
|
} |
51
|
|
|
|
52
|
|
|
public function update(Request $request, $generalSettingId) |
53
|
|
|
{ |
54
|
|
|
$result = GeneralSettingService::updateById($request->all(), $generalSettingId); |
55
|
|
|
return GeneralSettingService::notificationRedirect('general-setting.index', $result, 'The general setting was updated.'); |
56
|
|
|
} |
57
|
|
|
|
58
|
|
|
public function destroy($generalSettingId) |
59
|
|
|
{ |
60
|
|
|
$result = GeneralSettingService::destroy($generalSettingId); |
61
|
|
|
if ($result) { |
62
|
|
|
Notification::error('The general setting was deleted.'); |
63
|
|
|
return redirect()->route('general-setting.index'); |
64
|
|
|
} |
65
|
|
|
} |
66
|
|
|
} |
67
|
|
|
|
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