@@ -13,7 +13,7 @@ |
||
13 | 13 | */ |
14 | 14 | public function up() |
15 | 15 | { |
16 | - Schema::create(config('magiclink.magiclink_table', 'magic_links'), function (Blueprint $table) { |
|
16 | + Schema::create(config('magiclink.magiclink_table', 'magic_links'), function(Blueprint $table) { |
|
17 | 17 | $table->uuid('id')->primary(); |
18 | 18 | $table->string('token', 255); |
19 | 19 | $table->text('action'); |
@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | */ |
14 | 14 | public function up() |
15 | 15 | { |
16 | - Schema::table('magic_links', function (Blueprint $table) { |
|
16 | + Schema::table('magic_links', function(Blueprint $table) { |
|
17 | 17 | $table->string('access_code')->nullable(); |
18 | 18 | }); |
19 | 19 | } |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | public function down() |
27 | 27 | { |
28 | 28 | if (Schema::hasColumn('magic_links', 'access_code')) { |
29 | - Schema::table('magic_links', function (Blueprint $table) { |
|
29 | + Schema::table('magic_links', function(Blueprint $table) { |
|
30 | 30 | $table->dropColumn('access_code'); |
31 | 31 | }); |
32 | 32 | } |
@@ -10,7 +10,7 @@ |
||
10 | 10 | 'web', |
11 | 11 | ], |
12 | 12 | ], |
13 | - function () { |
|
13 | + function() { |
|
14 | 14 | Route::get( |
15 | 15 | config('magiclink.url.validate_path', 'magiclink').'/{token}', |
16 | 16 | 'MagicLink\Controllers\MagicLinkController@access' |
@@ -17,7 +17,7 @@ |
||
17 | 17 | |
18 | 18 | $magicLink = MagicLink::getValidMagicLinkByToken($token); |
19 | 19 | |
20 | - if (! $magicLink) { |
|
20 | + if ( ! $magicLink) { |
|
21 | 21 | return $this->badResponse(); |
22 | 22 | } |
23 | 23 |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | { |
23 | 23 | parent::boot(); |
24 | 24 | |
25 | - static::creating(function ($model) { |
|
25 | + static::creating(function($model) { |
|
26 | 26 | $model->id = Str::uuid(); |
27 | 27 | }); |
28 | 28 | } |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | */ |
119 | 119 | public function protectedWithAcessCode(): bool |
120 | 120 | { |
121 | - return !is_null($this->access_code ?? null); |
|
121 | + return ! is_null($this->access_code ?? null); |
|
122 | 122 | } |
123 | 123 | |
124 | 124 | /** |
@@ -163,12 +163,12 @@ discard block |
||
163 | 163 | |
164 | 164 | return self::where('id', $tokenId) |
165 | 165 | ->where('token', $tokenSecret) |
166 | - ->where(function ($query) { |
|
166 | + ->where(function($query) { |
|
167 | 167 | $query |
168 | 168 | ->whereNull('available_at') |
169 | 169 | ->orWhere('available_at', '>=', Carbon::now()); |
170 | 170 | }) |
171 | - ->where(function ($query) { |
|
171 | + ->where(function($query) { |
|
172 | 172 | $query |
173 | 173 | ->whereNull('max_visits') |
174 | 174 | ->orWhereRaw('max_visits > num_visits'); |
@@ -203,10 +203,10 @@ discard block |
||
203 | 203 | */ |
204 | 204 | public static function deleteMagicLinkExpired() |
205 | 205 | { |
206 | - self::where(function ($query) { |
|
206 | + self::where(function($query) { |
|
207 | 207 | $query |
208 | 208 | ->where('available_at', '<', Carbon::now()) |
209 | - ->orWhere(function ($query) { |
|
209 | + ->orWhere(function($query) { |
|
210 | 210 | $query |
211 | 211 | ->whereNotNull('max_visits') |
212 | 212 | ->whereRaw('max_visits <= num_visits'); |