|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace App\Http\Controllers\Admin; |
|
4
|
|
|
|
|
5
|
|
|
use App\Http\Controllers\Controller; |
|
6
|
|
|
use App\Models\LinkType; |
|
7
|
|
|
use Illuminate\Http\Request; |
|
8
|
|
|
use \App\Http\Requests\LinkTypeRequest; |
|
|
|
|
|
|
9
|
|
|
|
|
10
|
|
|
class LinkTypeController extends Controller |
|
11
|
|
|
{ |
|
12
|
|
|
/** |
|
13
|
|
|
* Display a listing of the resource. |
|
14
|
|
|
* |
|
15
|
|
|
* @return \Illuminate\Http\Response |
|
16
|
|
|
*/ |
|
17
|
|
|
public function index() |
|
18
|
|
|
{ |
|
19
|
|
|
// get all the sharks |
|
20
|
|
|
$LinkTypes = LinkType::all(); |
|
21
|
|
|
|
|
22
|
|
|
// load the view and pass the link types |
|
23
|
|
|
return View('panel.linktype.index') |
|
|
|
|
|
|
24
|
|
|
->with('linktype', $LinkTypes); |
|
25
|
|
|
} |
|
26
|
|
|
|
|
27
|
|
|
/** |
|
28
|
|
|
* Show the form for creating a new resource. |
|
29
|
|
|
* |
|
30
|
|
|
* @return \Illuminate\Http\Response |
|
31
|
|
|
*/ |
|
32
|
|
|
public function create() |
|
33
|
|
|
{ |
|
34
|
|
|
return View('panel.linktype.create'); |
|
|
|
|
|
|
35
|
|
|
} |
|
36
|
|
|
|
|
37
|
|
|
/** |
|
38
|
|
|
* Store a newly created resource in storage. |
|
39
|
|
|
* |
|
40
|
|
|
* @param \Illuminate\Http\Request $request |
|
41
|
|
|
* @return \Illuminate\Http\Response |
|
42
|
|
|
*/ |
|
43
|
|
|
public function store(LinkTypeRequest $request) |
|
44
|
|
|
{ |
|
45
|
|
|
// validate |
|
46
|
|
|
// read more on validation at http://laravel.com/docs/validation |
|
47
|
|
|
|
|
48
|
|
|
$validated = $request->validated(); |
|
|
|
|
|
|
49
|
|
|
|
|
50
|
|
|
// store |
|
51
|
|
|
$LinkType = new LinkType; |
|
52
|
|
|
$LinkType->typename = $request->typename; |
|
|
|
|
|
|
53
|
|
|
$LinkType->title = $request->title; |
|
|
|
|
|
|
54
|
|
|
$LinkType->description = $request->description; |
|
|
|
|
|
|
55
|
|
|
$LinkType->icon = $request->icon; |
|
|
|
|
|
|
56
|
|
|
$LinkType->params = $request->params; |
|
|
|
|
|
|
57
|
|
|
$LinkType->save(); |
|
58
|
|
|
|
|
59
|
|
|
// redirect |
|
60
|
|
|
return Redirect('admin/linktype') |
|
|
|
|
|
|
61
|
|
|
->with('success', 'New link type has been added.'); |
|
62
|
|
|
} |
|
63
|
|
|
|
|
64
|
|
|
/** |
|
65
|
|
|
* Display the specified resource. |
|
66
|
|
|
* |
|
67
|
|
|
* @param \App\Models\LinkType $linkType |
|
68
|
|
|
* @return \Illuminate\Http\Response |
|
69
|
|
|
*/ |
|
70
|
|
|
public function show(LinkType $linkType) |
|
|
|
|
|
|
71
|
|
|
{ |
|
72
|
|
|
// |
|
73
|
|
|
} |
|
74
|
|
|
|
|
75
|
|
|
/** |
|
76
|
|
|
* Show the form for editing the specified resource. |
|
77
|
|
|
* |
|
78
|
|
|
* @param \App\Models\LinkType $linkType |
|
79
|
|
|
* @return \Illuminate\Http\Response |
|
80
|
|
|
*/ |
|
81
|
|
|
public function edit($id) |
|
82
|
|
|
{ |
|
83
|
|
|
$lt = LinkType::find($id); |
|
84
|
|
|
// show the edit form and pass the shark |
|
85
|
|
|
return View('panel.linktype.edit', ['linktype' => $lt]); |
|
|
|
|
|
|
86
|
|
|
} |
|
87
|
|
|
|
|
88
|
|
|
/** |
|
89
|
|
|
* Update the specified resource in storage. |
|
90
|
|
|
* |
|
91
|
|
|
* @param \Illuminate\Http\Request $request |
|
92
|
|
|
* @param \App\Models\LinkType $linkType |
|
93
|
|
|
* @return \Illuminate\Http\Response |
|
94
|
|
|
*/ |
|
95
|
|
|
public function update(LinkTypeRequest $request, $id) |
|
96
|
|
|
{ |
|
97
|
|
|
$linktype = LinkType::find($id); |
|
98
|
|
|
|
|
99
|
|
|
$validated = $request->validated(); |
|
|
|
|
|
|
100
|
|
|
|
|
101
|
|
|
|
|
102
|
|
|
// store |
|
103
|
|
|
$linktype->title = $request->title; |
|
104
|
|
|
$linktype->description = $request->description; |
|
105
|
|
|
$linktype->icon = $request->icon; |
|
106
|
|
|
$linktype->params = $request->params; |
|
107
|
|
|
$linktype->save(); |
|
108
|
|
|
|
|
109
|
|
|
// redirect |
|
110
|
|
|
return Redirect('admin/linktype') |
|
|
|
|
|
|
111
|
|
|
->with('success', 'Link type updated.'); |
|
112
|
|
|
} |
|
113
|
|
|
|
|
114
|
|
|
/** |
|
115
|
|
|
* Remove the specified resource from storage. |
|
116
|
|
|
* |
|
117
|
|
|
* @param \App\Models\LinkType $linkType |
|
118
|
|
|
* @return \Illuminate\Http\Response |
|
119
|
|
|
*/ |
|
120
|
|
|
public function destroy($id) |
|
121
|
|
|
{ |
|
122
|
|
|
// delete |
|
123
|
|
|
$linktype = LinkType::find($id); |
|
124
|
|
|
$linktype->delete(); |
|
125
|
|
|
|
|
126
|
|
|
// redirect |
|
127
|
|
|
return Redirect('admin/linktype') |
|
|
|
|
|
|
128
|
|
|
->with('success', 'Link type deleted'); |
|
129
|
|
|
} |
|
130
|
|
|
} |
|
131
|
|
|
|
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