@@ -27,7 +27,7 @@ |
||
27 | 27 | protected function defineRoutes($router) |
28 | 28 | { |
29 | 29 | // Define routes. |
30 | - $router->get('login', function () { |
|
30 | + $router->get('login', function() { |
|
31 | 31 | return 'login'; |
32 | 32 | })->name('login'); |
33 | 33 |
@@ -21,7 +21,7 @@ |
||
21 | 21 | |
22 | 22 | $user = TestUser::create([ |
23 | 23 | 'name' => str::random(), |
24 | - 'email' => Str::random(40) . '@example.com', |
|
24 | + 'email' => Str::random(40).'@example.com', |
|
25 | 25 | 'password' => Hash::make('password'), |
26 | 26 | 'pin' => Hash::make('0000'), |
27 | 27 | ]); |
@@ -17,32 +17,32 @@ |
||
17 | 17 | $this->delayMinutes = $maxAttempts; |
18 | 18 | } |
19 | 19 | |
20 | - public function hasTooManyAttempts (Request $request) |
|
20 | + public function hasTooManyAttempts(Request $request) |
|
21 | 21 | { |
22 | 22 | return $this->hasTooManyLoginAttempts($request); |
23 | 23 | } |
24 | 24 | |
25 | - public function incrementAttempts (Request $request) |
|
25 | + public function incrementAttempts(Request $request) |
|
26 | 26 | { |
27 | 27 | return $this->incrementLoginAttempts($request); |
28 | 28 | } |
29 | 29 | |
30 | - public function clearAttempts (Request $request) |
|
30 | + public function clearAttempts(Request $request) |
|
31 | 31 | { |
32 | 32 | return $this->clearLoginAttempts($request); |
33 | 33 | } |
34 | 34 | |
35 | - public function _fireLockoutEvent (Request $request) |
|
35 | + public function _fireLockoutEvent(Request $request) |
|
36 | 36 | { |
37 | 37 | return $this->fireLockoutEvent($request); |
38 | 38 | } |
39 | 39 | |
40 | - public function _limiter () |
|
40 | + public function _limiter() |
|
41 | 41 | { |
42 | 42 | return $this->limiter(); |
43 | 43 | } |
44 | 44 | |
45 | - public function _throttleKey (Request $request) |
|
45 | + public function _throttleKey(Request $request) |
|
46 | 46 | { |
47 | 47 | return $this->throttleKey($request); |
48 | 48 | } |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | */ |
15 | 15 | public function up() |
16 | 16 | { |
17 | - Schema::table('users', function (Blueprint $table) { |
|
17 | + Schema::table('users', function(Blueprint $table) { |
|
18 | 18 | $table->string('pin')->after('password')->default(Hash::make(config('requirepin.default', '0000'))); |
19 | 19 | $table->tinyInteger('default_pin')->after('pin')->default(1); |
20 | 20 | }); |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | */ |
28 | 28 | public function down() |
29 | 29 | { |
30 | - Schema::table('users', function (Blueprint $table) { |
|
30 | + Schema::table('users', function(Blueprint $table) { |
|
31 | 31 | $table->dropColumn(['pin', 'default_pin']); |
32 | 32 | }); |
33 | 33 | } |
@@ -13,7 +13,7 @@ |
||
13 | 13 | */ |
14 | 14 | public function up() |
15 | 15 | { |
16 | - Schema::create('old_pins', function (Blueprint $table) { |
|
16 | + Schema::create('old_pins', function(Blueprint $table) { |
|
17 | 17 | $table->id(); |
18 | 18 | $table->foreignId('user_id')->constrained('users'); |
19 | 19 | $table->string('pin'); |
@@ -13,7 +13,7 @@ |
||
13 | 13 | */ |
14 | 14 | public function up() |
15 | 15 | { |
16 | - Schema::create('require_pins', function (Blueprint $table) { |
|
16 | + Schema::create('require_pins', function(Blueprint $table) { |
|
17 | 17 | $table->id(); |
18 | 18 | $table->foreignId('user_id')->constrained('users'); |
19 | 19 | $table->string('uuid')->unique(); |
@@ -4,7 +4,7 @@ |
||
4 | 4 | use Illuminate\Support\Facades\Route; |
5 | 5 | use Ikechukwukalu\Requirepin\Controllers\PinController; |
6 | 6 | |
7 | -Route::middleware('auth:sanctum')->group(function () { |
|
7 | +Route::middleware('auth:sanctum')->group(function() { |
|
8 | 8 | Route::post('change/pin', [PinController::class, 'changePin']) |
9 | 9 | ->name('changePin'); |
10 | 10 |
@@ -68,13 +68,13 @@ |
||
68 | 68 | 'REMOTE_ADDR' |
69 | 69 | ]; |
70 | 70 | |
71 | - foreach ($server_keys as $key){ |
|
71 | + foreach ($server_keys as $key) { |
|
72 | 72 | if (array_key_exists($key, $_SERVER) === true) { |
73 | 73 | foreach (explode(',', $_SERVER[$key]) as $ip) { |
74 | 74 | $ip = trim($ip); // just to be safe |
75 | 75 | |
76 | 76 | if (filter_var($ip, FILTER_VALIDATE_IP, |
77 | - FILTER_FLAG_NO_PRIV_RANGE | |
|
77 | + FILTER_FLAG_NO_PRIV_RANGE| |
|
78 | 78 | FILTER_FLAG_NO_RES_RANGE) !== false |
79 | 79 | ) { |
80 | 80 | return $ip; |
@@ -27,7 +27,7 @@ |
||
27 | 27 | 'current_pin' => ['required', 'string', new CurrentPin(true)], |
28 | 28 | 'pin' => [ |
29 | 29 | 'required', 'string', |
30 | - 'max:' . config('requirepin.max', 4), |
|
30 | + 'max:'.config('requirepin.max', 4), |
|
31 | 31 | Password::min(config('requirepin.min', 4))->numbers(), |
32 | 32 | 'confirmed', |
33 | 33 | new DisallowOldPin( |