@@ -13,7 +13,7 @@ |
||
13 | 13 | */ |
14 | 14 | public function up() |
15 | 15 | { |
16 | - Schema::create('otps', function (Blueprint $table) { |
|
16 | + Schema::create('otps', function(Blueprint $table) { |
|
17 | 17 | $table->id(); |
18 | 18 | $table->unsignedBigInteger('user_id')->nullable(); |
19 | 19 | $table->string('identifier'); |
@@ -24,8 +24,8 @@ discard block |
||
24 | 24 | if ($validity === null) $validity = config('otpify.validity'); |
25 | 25 | |
26 | 26 | Otp::where([ |
27 | - ['identifier', $identifier], |
|
28 | - ['otp_type', $otpType] |
|
27 | + [ 'identifier', $identifier ], |
|
28 | + [ 'otp_type', $otpType ] |
|
29 | 29 | ])->delete(); |
30 | 30 | |
31 | 31 | if (($digits >= 4) && ($digits <= 8)) { |
@@ -59,8 +59,8 @@ discard block |
||
59 | 59 | public static function validate(string $identifier, string $token, string $otpType = null) |
60 | 60 | { |
61 | 61 | $otp = Otp::where([ |
62 | - ['identifier', $identifier], |
|
63 | - ['otp_type', $otpType] |
|
62 | + [ 'identifier', $identifier ], |
|
63 | + [ 'otp_type', $otpType ] |
|
64 | 64 | ])->first(); |
65 | 65 | |
66 | 66 | if ($otp == null) { |