1 | <?php |
||||
2 | |||||
3 | namespace App\Http\Controllers; |
||||
4 | |||||
5 | use Illuminate\Http\Request; |
||||
6 | use App\User; |
||||
7 | |||||
8 | class MemberController extends Controller |
||||
9 | { |
||||
10 | /** |
||||
11 | * Display a listing of the resource. |
||||
12 | * |
||||
13 | * @return \Illuminate\Http\Response |
||||
14 | */ |
||||
15 | |||||
16 | public function index() |
||||
17 | { |
||||
18 | $user = User::orderBy('name','asc')->paginate(10); |
||||
19 | $data = [ |
||||
20 | 'role' => session('role'), |
||||
21 | 'user' => $user, |
||||
22 | ]; |
||||
23 | return view('pages.member')->with('data',$data); |
||||
0 ignored issues
–
show
Bug
Best Practice
introduced
by
![]() |
|||||
24 | } |
||||
25 | |||||
26 | /** |
||||
27 | * Show the form for creating a new resource. |
||||
28 | * |
||||
29 | * @return \Illuminate\Http\Response |
||||
30 | */ |
||||
31 | // public function create() |
||||
32 | // { |
||||
33 | // // |
||||
34 | // } |
||||
35 | |||||
36 | /** |
||||
37 | * Store a newly created resource in storage. |
||||
38 | * |
||||
39 | * @param \Illuminate\Http\Request $request |
||||
40 | * @return \Illuminate\Http\Response |
||||
41 | */ |
||||
42 | // public function store(Request $request) |
||||
43 | // { |
||||
44 | // // |
||||
45 | // } |
||||
46 | |||||
47 | /** |
||||
48 | * Display the specified resource. |
||||
49 | * |
||||
50 | * @param int $id |
||||
51 | * @return \Illuminate\Http\Response |
||||
52 | */ |
||||
53 | public function show($id) |
||||
0 ignored issues
–
show
The parameter
$id is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body. ![]() |
|||||
54 | { |
||||
55 | // |
||||
56 | } |
||||
57 | |||||
58 | /** |
||||
59 | * Show the form for editing the specified resource. |
||||
60 | * |
||||
61 | * @param int $id |
||||
62 | * @return \Illuminate\Http\Response |
||||
63 | */ |
||||
64 | public function edit($id) |
||||
0 ignored issues
–
show
The parameter
$id is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body. ![]() |
|||||
65 | { |
||||
66 | // |
||||
67 | } |
||||
68 | |||||
69 | /** |
||||
70 | * Update the specified resource in storage. |
||||
71 | * |
||||
72 | * @param \Illuminate\Http\Request $request |
||||
73 | * @param int $id |
||||
74 | * @return \Illuminate\Http\Response |
||||
75 | */ |
||||
76 | public function update(Request $request, $id) |
||||
77 | { |
||||
78 | $user = User::find($id); |
||||
79 | $user->status = $request->cond; |
||||
80 | $user->save(); |
||||
81 | |||||
82 | return redirect(route('member.index')); |
||||
0 ignored issues
–
show
|
|||||
83 | } |
||||
84 | |||||
85 | } |
||||
86 |