Code Duplication    Length = 10-12 lines in 2 locations

app/Http/Controllers/SensorDataController.php 2 locations

@@ 47-58 (lines=12) @@
44
    *
45
    * @return Response
46
    */
47
    public function store()
48
    {
49
        request()->validate([
50
            'sensor_id' => 'required|integer|exists:sensors,id',
51
            'value' => 'required|string|max:190'
52
        ]);
53
54
        $query = SensorData::create($request->all());
55
56
        return redirect()->route('sensordata.show', $query->id)
57
            ->with('success', 'SensorData created successfully');
58
    }
59
60
    /**
61
    * Display the specified resource.
@@ 93-102 (lines=10) @@
90
    * @param  int  $id
91
    * @return Response
92
    */
93
    public function update($id)
94
    {
95
        request()->validate([
96
            'sensor_id' => 'required|integer|exists:sensors,id',
97
            'value' => 'required|string|max:190'
98
        ]);
99
        $query = SensorData::findOrFail($id)->update($request->all());
100
        return redirect()->route('sensordata.show', $id)
101
            ->with('success', 'SensorData updated successfully');    
102
    }
103
104
    /**
105
    * Remove the specified resource from storage.