Scrutinizer GitHub App not installed

We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.

Install GitHub App

Completed
Push — development ( 7d5c92...5a02f8 )
by José
04:48
created

DonorController::update()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 1
nc 1
nop 2
1
<?php
2
3
namespace DoeSangue\Http\Controllers;
4
5
use DoeSangue\Models\Donor;
6
use Illuminate\Http\Request;
7
8
class DonorController extends Controller
9
{
10
    /**
11
     * Display a listing of the resource.
12
     *
13
     * @return \Illuminate\Http\Response
14
     */
15
    public function index()
16
    {
17
        $donors = Donor::orderBy('id', 'desc')->get();
18
19
        return view('donors.index', compact('donors'));
20
    }
21
22
    /**
23
     * Show the form for creating a new resource.
24
     *
25
     * @return \Illuminate\Http\Response
26
     */
27
    public function create()
28
    {
29
        return view('donors.create');
30
    }
31
32
    /**
33
     * Store a newly created resource in storage.
34
     *
35
     * @param \Illuminate\Http\Request $request
36
     *
37
     * @return \Illuminate\Http\Response
38
     */
39
    public function store(Request $request)
40
    {
41
        $this->validate(
42
            $request,
43
            [
44
            'user_id' => 'required',
45
            'blood_type_id' => 'required',
46
            ]
47
        );
48
49
        $donor = new Donor();
50
        $donor->user_id => $request['user_id'];
0 ignored issues
show
Bug introduced by
This code did not parse for me. Apparently, there is an error somewhere around this line:

Syntax error, unexpected T_DOUBLE_ARROW
Loading history...
51
        $donor->blood_type_id => $request['blood_type_id'];
52
        $donor->save();
53
54
        return redirect()->route('user.profile');
55
    }
56
57
    /**
58
     * Display the specified resource.
59
     *
60
     * @param int $id
61
     *
62
     * @return \Illuminate\Http\Response
63
     */
64
    public function show($id)
65
    {
66
        $donor = Donor::find($id);
67
68
        return view('donors.Show', compact('donor'));
69
    }
70
71
    /**
72
     * Show the form for editing the specified resource.
73
     *
74
     * @param int $id
75
     *
76
     * @return \Illuminate\Http\Response
77
     */
78
    public function edit($id)
79
    {
80
        return view('donors.edit');
81
    }
82
83
    /**
84
     * Update the specified resource in storage.
85
     *
86
     * @param \Illuminate\Http\Request $request
87
     * @param int                      $id
88
     *
89
     * @return \Illuminate\Http\Response
90
     */
91
    public function update(Request $request, $id)
92
    {
93
        $this->validate(
94
            $request,
95
            [
96
              ''
97
            ]
98
        );
99
        $donor = Donor::find($id);
100
    }
101
102
    /**
103
     * Remove the specified resource from storage.
104
     *
105
     * @param int $id
106
     *
107
     * @return \Illuminate\Http\Response
108
     */
109
    public function destroy($id)
110
    {
111
    }
112
}
113