@@ -59,7 +59,7 @@ |
||
| 59 | 59 | */ |
| 60 | 60 | public function boot(Router $router) |
| 61 | 61 | { |
| 62 | - $router->middlewareGroup('activity',[LogActivity::class]); |
|
| 62 | + $router->middlewareGroup('activity', [LogActivity::class]); |
|
| 63 | 63 | $this->loadTranslationsFrom(__DIR__.'/resources/lang/', 'LaravelLogger'); |
| 64 | 64 | } |
| 65 | 65 | |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | */ |
| 43 | 43 | private function mapAdditionalDetails($collectionItems) |
| 44 | 44 | { |
| 45 | - $collectionItems->map(function ($collectionItem) { |
|
| 45 | + $collectionItems->map(function($collectionItem) { |
|
| 46 | 46 | $eventTime = Carbon::parse($collectionItem->updated_at); |
| 47 | 47 | $collectionItem['timePassed'] = $eventTime->diffForHumans(); |
| 48 | 48 | $collectionItem['userAgentDetails'] = UserAgentDetails::details($collectionItem->useragent); |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | |
| 111 | 111 | self::mapAdditionalDetails($userActivities); |
| 112 | 112 | |
| 113 | - $data = [ |
|
| 113 | + $data = [ |
|
| 114 | 114 | 'activity' => $activity, |
| 115 | 115 | 'userDetails' => $userDetails, |
| 116 | 116 | 'ipAddressDetails' => $ipAddressDetails, |
@@ -187,7 +187,7 @@ discard block |
||
| 187 | 187 | $eventTime = Carbon::parse($activity->created_at); |
| 188 | 188 | $timePassed = $eventTime->diffForHumans(); |
| 189 | 189 | |
| 190 | - $data = [ |
|
| 190 | + $data = [ |
|
| 191 | 191 | 'activity' => $activity, |
| 192 | 192 | 'userDetails' => $userDetails, |
| 193 | 193 | 'ipAddressDetails' => $ipAddressDetails, |
@@ -37,7 +37,7 @@ |
||
| 37 | 37 | "SA" => "South America" |
| 38 | 38 | ); |
| 39 | 39 | if (filter_var($ip, FILTER_VALIDATE_IP) && in_array($purpose, $support)) { |
| 40 | - $ipdat = @json_decode(file_get_contents("http://www.geoplugin.net/json.gp?ip=" . $ip)); |
|
| 40 | + $ipdat = @json_decode(file_get_contents("http://www.geoplugin.net/json.gp?ip=".$ip)); |
|
| 41 | 41 | if (@strlen(trim($ipdat->geoplugin_countryCode)) == 2) { |
| 42 | 42 | switch ($purpose) { |
| 43 | 43 | case "location": |
@@ -20,14 +20,14 @@ discard block |
||
| 20 | 20 | $userType = trans('LaravelLogger::laravel-logger.userTypes.guest'); |
| 21 | 21 | $userId = null; |
| 22 | 22 | |
| 23 | - if(\Auth::check()) { |
|
| 23 | + if (\Auth::check()) { |
|
| 24 | 24 | $userType = trans('LaravelLogger::laravel-logger.userTypes.registered'); |
| 25 | 25 | $userId = \Request::user()->id; |
| 26 | 26 | } |
| 27 | 27 | |
| 28 | - if(Crawler::isCrawler()) { |
|
| 28 | + if (Crawler::isCrawler()) { |
|
| 29 | 29 | $userType = trans('LaravelLogger::laravel-logger.userTypes.crawler'); |
| 30 | - $description = $userType . ' ' . trans('LaravelLogger::laravel-logger.verbTypes.crawled') . ' ' . \Request::fullUrl(); |
|
| 30 | + $description = $userType.' '.trans('LaravelLogger::laravel-logger.verbTypes.crawled').' '.\Request::fullUrl(); |
|
| 31 | 31 | } |
| 32 | 32 | |
| 33 | 33 | if (!$description) { |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | break; |
| 52 | 52 | } |
| 53 | 53 | |
| 54 | - $description = $verb . ' ' . \Request::path(); |
|
| 54 | + $description = $verb.' '.\Request::path(); |
|
| 55 | 55 | } |
| 56 | 56 | |
| 57 | 57 | $data = [ |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | if ($validator->fails()) { |
| 72 | 72 | $errors = json_encode($validator->errors(), true); |
| 73 | 73 | if (config('LaravelLogger.logDBActivityLogFailuresToFile')) { |
| 74 | - Log::error('Failed to record activity event. Failed Validation: ' . $errors); |
|
| 74 | + Log::error('Failed to record activity event. Failed Validation: '.$errors); |
|
| 75 | 75 | } |
| 76 | 76 | } else { |
| 77 | 77 | self::storeActivity($data); |
@@ -15,7 +15,7 @@ |
||
| 15 | 15 | $routeUrl .= $parsedUrl['path']; |
| 16 | 16 | } |
| 17 | 17 | if (isset($parsedUrl['query'])) { |
| 18 | - $routeUrl .= '?' . $parsedUrl['query']; |
|
| 18 | + $routeUrl .= '?'.$parsedUrl['query']; |
|
| 19 | 19 | } |
| 20 | 20 | echo $routeUrl; |
| 21 | 21 | } |
@@ -123,7 +123,7 @@ |
||
| 123 | 123 | * |
| 124 | 124 | * @return array |
| 125 | 125 | */ |
| 126 | - public static function rules($merge=[]) |
|
| 126 | + public static function rules($merge = []) |
|
| 127 | 127 | { |
| 128 | 128 | return array_merge([ |
| 129 | 129 | 'description' => 'required|string', |
@@ -20,7 +20,7 @@ |
||
| 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'); |
@@ -7,7 +7,7 @@ |
||
| 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'); |
@@ -33,13 +33,13 @@ |
||
| 33 | 33 | | Laravel Logger Authentication Listeners Enable/Disable |
| 34 | 34 | |-------------------------------------------------------------------------- |
| 35 | 35 | */ |
| 36 | - 'logAllAuthEvents' => false, // May cause a lot of duplication. |
|
| 37 | - 'logAuthAttempts' => false, // Successful and Failed - May cause a lot of duplication. |
|
| 38 | - 'logFailedAuthAttempts' => true, // Failed Logins |
|
| 39 | - 'logLockOut' => true, // Account Lockout |
|
| 40 | - 'logPasswordReset' => true, // Password Resets |
|
| 41 | - 'logSuccessfulLogin' => true, // Successful Login |
|
| 42 | - 'logSuccessfulLogout' => true, // Successful Logout |
|
| 36 | + 'logAllAuthEvents' => false, // May cause a lot of duplication. |
|
| 37 | + 'logAuthAttempts' => false, // Successful and Failed - May cause a lot of duplication. |
|
| 38 | + 'logFailedAuthAttempts' => true, // Failed Logins |
|
| 39 | + 'logLockOut' => true, // Account Lockout |
|
| 40 | + 'logPasswordReset' => true, // Password Resets |
|
| 41 | + 'logSuccessfulLogin' => true, // Successful Login |
|
| 42 | + 'logSuccessfulLogout' => true, // Successful Logout |
|
| 43 | 43 | |
| 44 | 44 | /* |
| 45 | 45 | |-------------------------------------------------------------------------- |