Completed
Push — user-management ( d87e21 )
by Tony
03:32
created
app/Http/Controllers/UserController.php 1 patch
Doc Comments   +2 added lines, -3 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
      * Store a newly created resource in storage.
53 53
      *
54 54
      * @param CreateUserRequest $request
55
-     * @return \Illuminate\Http\Response
55
+     * @return \Illuminate\Http\JsonResponse
56 56
      */
57 57
     public function store(CreateUserRequest $request)
58 58
     {
@@ -95,7 +95,6 @@  discard block
 block discarded – undo
95 95
      * @param UpdateUserRequest|Request $request
96 96
      * @param $user_id
97 97
      * @param $type Type of update info|password|adddevice|removedevice|addpor|removeport
98
-     * @param  int $id
99 98
      * @return \Illuminate\Http\Response
100 99
      */
101 100
     public function update(UpdateUserRequest $request, $user_id)
@@ -111,7 +110,7 @@  discard block
 block discarded – undo
111 110
      * Remove the specified resource from storage.
112 111
      *
113 112
      * @param  int $user_id
114
-     * @return \Illuminate\Http\Response
113
+     * @return \Illuminate\Http\JsonResponse
115 114
      */
116 115
     public function destroy(DeleteUserRequest $request, $user_id)
117 116
     {
Please login to merge, or discard this patch.
app/Http/Controllers/UserDeviceController.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -25,7 +25,6 @@
 block discarded – undo
25 25
 
26 26
 namespace App\Http\Controllers;
27 27
 
28
-use App\Http\Requests;
29 28
 use App\Http\Requests\AdminOnlyRequest;
30 29
 use App\Models\Device;
31 30
 use App\Models\User;
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -48,11 +48,11 @@
 block discarded – undo
48 48
         $user = User::find($user_id);
49 49
 
50 50
         $device_ids = $request->input('devices');
51
-        if(count($device_ids) == 0) {
51
+        if (count($device_ids) == 0) {
52 52
             return redirect()->back();
53 53
         }
54 54
         
55
-        foreach($device_ids as $device_id) {
55
+        foreach ($device_ids as $device_id) {
56 56
             $device = Device::find($device_id);
57 57
             $user->devices()->attach($device);
58 58
         }
Please login to merge, or discard this patch.
app/Http/Controllers/UserPortController.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -25,7 +25,6 @@
 block discarded – undo
25 25
 
26 26
 namespace App\Http\Controllers;
27 27
 
28
-use App\Http\Requests;
29 28
 use App\Http\Requests\AdminOnlyRequest;
30 29
 use App\Models\Port;
31 30
 use App\Models\User;
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -54,11 +54,11 @@
 block discarded – undo
54 54
         $user = User::find($user_id);
55 55
 
56 56
         $port_ids = $request->input('ports');
57
-        if(count($port_ids) == 0) {
57
+        if (count($port_ids) == 0) {
58 58
             return redirect()->back();
59 59
         }
60 60
         
61
-        foreach($port_ids as $port_id) {
61
+        foreach ($port_ids as $port_id) {
62 62
             $port = Port::find($port_id);
63 63
             $user->ports()->attach($port);
64 64
         }
Please login to merge, or discard this patch.
app/Http/Requests/UpdateUserRequest.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@
 block discarded – undo
55 55
     {
56 56
         if ($this->input('password')) {
57 57
             $rules = ['password'              => 'required|min:5|max:255',
58
-                      'password_confirmation' => 'required|same:password',
58
+                        'password_confirmation' => 'required|same:password',
59 59
             ];
60 60
             if (!Auth::user()->isAdmin()) {
61 61
                 $rules['current_password'] = 'required|password:user_id';
Please login to merge, or discard this patch.
app/Models/User.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -122,7 +122,7 @@
 block discarded – undo
122 122
      * Encrypt passwords before saving
123 123
      * @param $password
124 124
      */
125
-    public function setPasswordAttribute($password){
125
+    public function setPasswordAttribute($password) {
126 126
         $this->attributes['password'] = bcrypt($password);
127 127
     }
128 128
 }
Please login to merge, or discard this patch.