Test Failed
Push — dev5 ( e927b9...4863c0 )
by Ron
06:38
created
app/Http/Controllers/AccountController.php 2 patches
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -135,14 +135,14 @@  discard block
 block discarded – undo
135 135
         //  Validate the hash token
136 136
         $user = UserInitialize::where('token', $hash)->get();
137 137
 
138
-        if ($user->isEmpty()) {
139
-            Log::debug('Route ' . Route::currentRouteName() . ' visited by User ID-' . Auth::user()->user_id);
140
-            Log::warning('Visitor at IP Address ' . \Request::ip() . ' tried to access invalid initialize hash - ' . $hash);
138
+        if($user->isEmpty()) {
139
+            Log::debug('Route '.Route::currentRouteName().' visited by User ID-'.Auth::user()->user_id);
140
+            Log::warning('Visitor at IP Address '.\Request::ip().' tried to access invalid initialize hash - '.$hash);
141 141
             return abort(404);
142 142
         }
143 143
 
144
-        Log::debug('Route ' . Route::currentRouteName() . ' visited.');
145
-        Log::debug('Link Hash -' . $hash);
144
+        Log::debug('Route '.Route::currentRouteName().' visited.');
145
+        Log::debug('Link Hash -'.$hash);
146 146
         return view('account.initializeUser', ['hash' => $hash]);
147 147
     }
148 148
 
@@ -151,9 +151,9 @@  discard block
 block discarded – undo
151 151
     {
152 152
         //  Verify that the link matches the assigned email address
153 153
         $valid = UserInitialize::where('token', $hash)->first();
154
-        if (empty($valid)) {
155
-            Log::debug('Route ' . Route::currentRouteName() . ' visited by User ID-' . Auth::user()->user_id);
156
-            Log::warning('Visitor at IP Address ' . \Request::ip() . ' tried to submit an invalid User Initialization link - ' . $hash);
154
+        if(empty($valid)) {
155
+            Log::debug('Route '.Route::currentRouteName().' visited by User ID-'.Auth::user()->user_id);
156
+            Log::warning('Visitor at IP Address '.\Request::ip().' tried to submit an invalid User Initialization link - '.$hash);
157 157
             return abort(404);
158 158
         }
159 159
 
@@ -186,8 +186,8 @@  discard block
 block discarded – undo
186 186
         Auth::loginUsingID($userData->user_id);
187 187
 
188 188
         //  Redirect the user to the dashboard
189
-        Log::debug('Route ' . Route::currentRouteName() . ' visited by User ID-' . Auth::user()->user_id);
190
-        Log::debug('Initialize Data - ' . $request->toArray());
189
+        Log::debug('Route '.Route::currentRouteName().' visited by User ID-'.Auth::user()->user_id);
190
+        Log::debug('Initialize Data - '.$request->toArray());
191 191
         Log::notice('User has setup account', ['user_id' => $userData->user_id]);
192 192
         return redirect(route('dashboard'));
193 193
     }
Please login to merge, or discard this patch.
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -135,7 +135,8 @@  discard block
 block discarded – undo
135 135
         //  Validate the hash token
136 136
         $user = UserInitialize::where('token', $hash)->get();
137 137
 
138
-        if ($user->isEmpty()) {
138
+        if ($user->isEmpty())
139
+        {
139 140
             Log::debug('Route ' . Route::currentRouteName() . ' visited by User ID-' . Auth::user()->user_id);
140 141
             Log::warning('Visitor at IP Address ' . \Request::ip() . ' tried to access invalid initialize hash - ' . $hash);
141 142
             return abort(404);
@@ -151,7 +152,8 @@  discard block
 block discarded – undo
151 152
     {
152 153
         //  Verify that the link matches the assigned email address
153 154
         $valid = UserInitialize::where('token', $hash)->first();
154
-        if (empty($valid)) {
155
+        if (empty($valid))
156
+        {
155 157
             Log::debug('Route ' . Route::currentRouteName() . ' visited by User ID-' . Auth::user()->user_id);
156 158
             Log::warning('Visitor at IP Address ' . \Request::ip() . ' tried to submit an invalid User Initialization link - ' . $hash);
157 159
             return abort(404);
Please login to merge, or discard this patch.
app/Http/Controllers/Admin/UserController.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -28,8 +28,8 @@  discard block
 block discarded – undo
28 28
     public function __construct()
29 29
     {
30 30
         $this->middleware('auth')->except('initializeUser', 'submitInitializeUser');
31
-        $this->middleware(function ($request, $next) {
32
-            $this->user = auth()->user();  //  TODO - is this correct????
31
+        $this->middleware(function($request, $next) {
32
+            $this->user = auth()->user(); //  TODO - is this correct????
33 33
             $this->authorize('hasAccess', 'Manage Users');
34 34
             return $next($request);
35 35
         });
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
     {
99 99
         //  Validate the new user form
100 100
         $request->validate([
101
-            'role'       => 'required|numeric',  //  TODO - add validation rule - is in user roles table
101
+            'role'       => 'required|numeric', //  TODO - add validation rule - is in user roles table
102 102
             'username'   => 'required|unique:users|regex:/^[a-zA-Z0-9_]*$/',
103 103
             'first_name' => 'required',
104 104
             'last_name'  => 'required',
Please login to merge, or discard this patch.
database/migrations/2018_05_31_001549_create_tech_tip_comments_table.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@
 block discarded – undo
20 20
             $table->longText('comment');
21 21
             $table->timestamps();
22 22
             $table->foreign('tip_id')->references('tip_id')->on('tech_tips')->onUpdate('cascade')->onDelete('cascade');
23
-            $table->foreign('user_id')->references('user_id')->on('users')->onUpdate('cascade');  //  TODO - add this key in v5 updates if it does not exist
23
+            $table->foreign('user_id')->references('user_id')->on('users')->onUpdate('cascade'); //  TODO - add this key in v5 updates if it does not exist
24 24
         });
25 25
     }
26 26
 
Please login to merge, or discard this patch.