1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Adminetic\Website\Http\Controllers\Admin; |
4
|
|
|
|
5
|
|
|
use Adminetic\Website\Contracts\CategoryRepositoryInterface; |
6
|
|
|
use Adminetic\Website\Http\Requests\CategoryRequest; |
7
|
|
|
use Adminetic\Website\Models\Admin\Category; |
8
|
|
|
use App\Http\Controllers\Controller; |
|
|
|
|
9
|
|
|
|
10
|
|
|
class CategoryController extends Controller |
11
|
|
|
{ |
12
|
|
|
protected $categoryRepositoryInterface; |
13
|
|
|
|
14
|
|
|
public function __construct(CategoryRepositoryInterface $categoryRepositoryInterface) |
15
|
|
|
{ |
16
|
|
|
$this->categoryRepositoryInterface = $categoryRepositoryInterface; |
17
|
|
|
$this->authorizeResource(Category::class, 'category'); |
18
|
|
|
} |
19
|
|
|
|
20
|
|
|
/** |
21
|
|
|
* Display a listing of the resource. |
22
|
|
|
* |
23
|
|
|
* @return \Illuminate\Http\Response |
24
|
|
|
*/ |
25
|
|
|
public function index() |
26
|
|
|
{ |
27
|
|
|
return view('website::admin.category.index', $this->categoryRepositoryInterface->indexCategory()); |
|
|
|
|
28
|
|
|
} |
29
|
|
|
|
30
|
|
|
/** |
31
|
|
|
* Show the form for creating a new resource. |
32
|
|
|
* |
33
|
|
|
* @return \Illuminate\Http\Response |
34
|
|
|
*/ |
35
|
|
|
public function create() |
36
|
|
|
{ |
37
|
|
|
return view('website::admin.category.create'); |
|
|
|
|
38
|
|
|
} |
39
|
|
|
|
40
|
|
|
/** |
41
|
|
|
* Store a newly created resource in storage. |
42
|
|
|
* |
43
|
|
|
* @param \Adminetic\Website\Http\Requests\CategoryRequest $request |
44
|
|
|
* @return \Illuminate\Http\Response |
45
|
|
|
*/ |
46
|
|
|
public function store(CategoryRequest $request) |
47
|
|
|
{ |
48
|
|
|
$this->categoryRepositoryInterface->storeCategory($request); |
49
|
|
|
|
50
|
|
|
return redirect(adminRedirectRoute('category'))->withSuccess('Category Created Successfully.'); |
|
|
|
|
51
|
|
|
} |
52
|
|
|
|
53
|
|
|
/** |
54
|
|
|
* Display the specified resource. |
55
|
|
|
* |
56
|
|
|
* @param \Adminetic\Website\Models\Admin\Category $category |
57
|
|
|
* @return \Illuminate\Http\Response |
58
|
|
|
*/ |
59
|
|
|
public function show(Category $category) |
60
|
|
|
{ |
61
|
|
|
return view('website::admin.category.show', $this->categoryRepositoryInterface->showCategory($category)); |
|
|
|
|
62
|
|
|
} |
63
|
|
|
|
64
|
|
|
/** |
65
|
|
|
* Show the form for editing the specified resource. |
66
|
|
|
* |
67
|
|
|
* @param \Adminetic\Website\Models\Admin\Category $category |
68
|
|
|
* @return \Illuminate\Http\Response |
69
|
|
|
*/ |
70
|
|
|
public function edit(Category $category) |
71
|
|
|
{ |
72
|
|
|
return view('website::admin.category.edit', $this->categoryRepositoryInterface->editCategory($category)); |
|
|
|
|
73
|
|
|
} |
74
|
|
|
|
75
|
|
|
/** |
76
|
|
|
* Update the specified resource in storage. |
77
|
|
|
* |
78
|
|
|
* @param \Adminetic\Website\Http\Requests\CategoryRequest $request |
79
|
|
|
* @param \Adminetic\Website\Models\Admin\Category $category |
80
|
|
|
* @return \Illuminate\Http\Response |
81
|
|
|
*/ |
82
|
|
|
public function update(CategoryRequest $request, Category $category) |
83
|
|
|
{ |
84
|
|
|
$this->categoryRepositoryInterface->updateCategory($request, $category); |
85
|
|
|
|
86
|
|
|
return redirect(adminRedirectRoute('category'))->withInfo('Category Updated Successfully.'); |
|
|
|
|
87
|
|
|
} |
88
|
|
|
|
89
|
|
|
/** |
90
|
|
|
* Remove the specified resource from storage. |
91
|
|
|
* |
92
|
|
|
* @param \Adminetic\Website\Models\Admin\Category $category |
93
|
|
|
* @return \Illuminate\Http\Response |
94
|
|
|
*/ |
95
|
|
|
public function destroy(Category $category) |
96
|
|
|
{ |
97
|
|
|
$this->categoryRepositoryInterface->destroyCategory($category); |
98
|
|
|
|
99
|
|
|
return redirect(adminRedirectRoute('category'))->withFail('Category Deleted Successfully.'); |
|
|
|
|
100
|
|
|
} |
101
|
|
|
} |
102
|
|
|
|
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