Completed
Pull Request — master (#59)
by
unknown
62:03
created
migrations/2017_11_04_103444_create_laravel_logger_activity_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
         $tableCheck = Schema::connection($connection)->hasTable($table);
21 21
 
22 22
         if (!$tableCheck) {
23
-            Schema::connection($connection)->create($table, function (Blueprint $table) {
23
+            Schema::connection($connection)->create($table, function(Blueprint $table) {
24 24
                 $table->increments('id');
25 25
                 $table->longText('description');
26 26
                 $table->string('userType');
Please login to merge, or discard this patch.
src/resources/lang/en/laravel-logger.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -137,11 +137,11 @@
 block discarded – undo
137 137
     |--------------------------------------------------------------------------
138 138
     */
139 139
 
140
-   'messages' => [
140
+    'messages' => [
141 141
         'logClearedSuccessfuly'   => 'Activity log cleared successfully',
142 142
         'logDestroyedSuccessfuly' => 'Activity log deleted successfully',
143 143
         'logRestoredSuccessfuly'  => 'Activity log restored successfully',
144
-   ],
144
+    ],
145 145
 
146 146
     /*
147 147
     |--------------------------------------------------------------------------
Please login to merge, or discard this patch.
src/app/Http/Traits/UserAgentDetails.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -37,10 +37,10 @@
 block discarded – undo
37 37
         $ua_array = explode('|', preg_replace($regex_pat, $replace_pat, $ua, PREG_PATTERN_ORDER));
38 38
 
39 39
         if (count($ua_array) > 1) {
40
-            $return['platform'] = $ua_array[0];  // Windows / iPad / MacOS / BlackBerry
41
-            $return['type'] = $ua_array[1];  // Mozilla / Opera etc.
42
-            $return['renderer'] = $ua_array[2];  // WebKit / Presto / Trident / Gecko etc.
43
-            $return['browser'] = $ua_array[3];  // Chrome / Safari / MSIE / Firefox
40
+            $return['platform'] = $ua_array[0]; // Windows / iPad / MacOS / BlackBerry
41
+            $return['type'] = $ua_array[1]; // Mozilla / Opera etc.
42
+            $return['renderer'] = $ua_array[2]; // WebKit / Presto / Trident / Gecko etc.
43
+            $return['browser'] = $ua_array[3]; // Chrome / Safari / MSIE / Firefox
44 44
 
45 45
             /*
46 46
                Not necessary but this will filter out Chromes ridiculously long version
Please login to merge, or discard this patch.
src/routes/web.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@
 block discarded – undo
7 7
 |
8 8
 */
9 9
 
10
-Route::group(['prefix' => 'activity', 'namespace' => 'jeremykenedy\LaravelLogger\App\Http\Controllers', 'middleware' => ['web', 'auth', 'activity']], function () {
10
+Route::group(['prefix' => 'activity', 'namespace' => 'jeremykenedy\LaravelLogger\App\Http\Controllers', 'middleware' => ['web', 'auth', 'activity']], function() {
11 11
 
12 12
     // Dashboards
13 13
     Route::get('/', 'LaravelLoggerController@showAccessLog')->name('activity');
Please login to merge, or discard this patch.
src/resources/lang/de/laravel-logger.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -137,11 +137,11 @@
 block discarded – undo
137 137
     |--------------------------------------------------------------------------
138 138
     */
139 139
 
140
-   'messages' => [
140
+    'messages' => [
141 141
         'logClearedSuccessfuly'   => 'Aktivitätslog erfolgreich geleert',
142 142
         'logDestroyedSuccessfuly' => 'Aktivitätslog erfolgreich gelöscht',
143 143
         'logRestoredSuccessfuly'  => 'Aktivitätslog erfolgreich wiederhergestellt',
144
-   ],
144
+    ],
145 145
 
146 146
     /*
147 147
     |--------------------------------------------------------------------------
Please login to merge, or discard this patch.
src/app/Http/Traits/ActivityLogger.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -112,7 +112,7 @@
 block discarded – undo
112 112
     private static function prepareErrorMessage($validatorErrors, $data)
113 113
     {
114 114
         $errors = json_decode(json_encode($validatorErrors, true));
115
-        array_walk($errors, function (&$value, $key) use ($data) {
115
+        array_walk($errors, function(&$value, $key) use ($data) {
116 116
             array_push($value, "Value: $data[$key]");
117 117
         });
118 118
 
Please login to merge, or discard this patch.
src/app/Http/Controllers/LaravelLoggerController.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -282,7 +282,7 @@
 block discarded – undo
282 282
      */
283 283
     public function searchActivityLog($query,$requeset)
284 284
     {
285
-     if (config('LaravelLogger.descriptionSearch') && $requeset->get('description')) {
285
+        if (config('LaravelLogger.descriptionSearch') && $requeset->get('description')) {
286 286
         $query->where('description','like','%'.$requeset->get('description').'%');
287 287
     }
288 288
 
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
      */
46 46
     private function mapAdditionalDetails($collectionItems)
47 47
     {
48
-        $collectionItems->map(function ($collectionItem) {
48
+        $collectionItems->map(function($collectionItem) {
49 49
             $eventTime = Carbon::parse($collectionItem->updated_at);
50 50
             $collectionItem['timePassed'] = $eventTime->diffForHumans();
51 51
             $collectionItem['userAgentDetails'] = UserAgentDetails::details($collectionItem->useragent);
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
         if (config('LaravelLogger.loggerPaginationEnabled')) {
69 69
             $activities = Activity::orderBy('created_at', 'desc');
70 70
             if (config('LaravelLogger.disableSearch')) {
71
-                $activities = $this->searchActivityLog($activities,$request);
71
+                $activities = $this->searchActivityLog($activities, $request);
72 72
             }
73 73
             $activities = $activities->paginate(config('LaravelLogger.loggerPaginationPerPage'));
74 74
             $totalActivities = $activities->total();
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
             $activities = Activity::orderBy('created_at', 'desc');
77 77
 
78 78
             if (config('LaravelLogger.disableSearch')) {
79
-                $activities = $this->searchActivityLog($activities,$request);
79
+                $activities = $this->searchActivityLog($activities, $request);
80 80
             }
81 81
             $activities = $activities->get();
82 82
             $totalActivities = $activities->count();
@@ -280,27 +280,27 @@  discard block
 block discarded – undo
280 280
      *
281 281
      * @return filtered query
282 282
      */
283
-    public function searchActivityLog($query,$requeset)
283
+    public function searchActivityLog($query, $requeset)
284 284
     {
285 285
      if (config('LaravelLogger.descriptionSearch') && $requeset->get('description')) {
286
-        $query->where('description','like','%'.$requeset->get('description').'%');
286
+        $query->where('description', 'like', '%'.$requeset->get('description').'%');
287 287
     }
288 288
 
289 289
 
290 290
     if (config('LaravelLogger.userSearch') && $requeset->get('user')) {
291
-        $query->where('userId','=',$requeset->get('user'));
291
+        $query->where('userId', '=', $requeset->get('user'));
292 292
     }
293 293
 
294 294
     if (config('LaravelLogger.methodSearch') && $requeset->get('method')) {
295
-        $query->where('methodType','=',$requeset->get('method'));
295
+        $query->where('methodType', '=', $requeset->get('method'));
296 296
     }
297 297
 
298 298
     if (config('LaravelLogger.routeSearch') && $requeset->get('route')) {
299
-        $query->where('route','like','%'.$requeset->get('route').'%');
299
+        $query->where('route', 'like', '%'.$requeset->get('route').'%');
300 300
     }
301 301
 
302 302
     if (config('LaravelLogger.ipAddressSearch') && $requeset->get('ip_address')) {
303
-        $query->where('ipAddress','like','%'.$requeset->get('ip_address').'%');
303
+        $query->where('ipAddress', 'like', '%'.$requeset->get('ip_address').'%');
304 304
     }
305 305
 
306 306
     return $query;
Please login to merge, or discard this patch.
src/config/laravel-logger.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@
 block discarded – undo
43 43
     'logSuccessfulLogout'   => true,    // Successful Logout
44 44
 
45 45
 
46
-     /*
46
+        /*
47 47
     |--------------------------------------------------------------------------
48 48
     | Laravel Logger Search Enable/Disable
49 49
     |--------------------------------------------------------------------------
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -34,13 +34,13 @@
 block discarded – undo
34 34
     | Laravel Logger Authentication Listeners Enable/Disable
35 35
     |--------------------------------------------------------------------------
36 36
     */
37
-    'logAllAuthEvents'      => false,   // May cause a lot of duplication.
38
-    'logAuthAttempts'       => false,   // Successful and Failed -  May cause a lot of duplication.
39
-    'logFailedAuthAttempts' => true,    // Failed Logins
40
-    'logLockOut'            => true,    // Account Lockout
41
-    'logPasswordReset'      => true,    // Password Resets
42
-    'logSuccessfulLogin'    => true,    // Successful Login
43
-    'logSuccessfulLogout'   => true,    // Successful Logout
37
+    'logAllAuthEvents'      => false, // May cause a lot of duplication.
38
+    'logAuthAttempts'       => false, // Successful and Failed -  May cause a lot of duplication.
39
+    'logFailedAuthAttempts' => true, // Failed Logins
40
+    'logLockOut'            => true, // Account Lockout
41
+    'logPasswordReset'      => true, // Password Resets
42
+    'logSuccessfulLogin'    => true, // Successful Login
43
+    'logSuccessfulLogout'   => true, // Successful Logout
44 44
 
45 45
 
46 46
      /*
Please login to merge, or discard this patch.