Skip to content

Commit 7699740

Browse files
committed
constrcutor properties for supported events
1 parent 853812f commit 7699740

File tree

3 files changed

+6
-36
lines changed

3 files changed

+6
-36
lines changed

src/Events/RecoveryCodeReplaced.php

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,15 @@
22

33
namespace Stephenjude\FilamentTwoFactorAuthentication\Events;
44

5-
use Filament\Models\Contracts\FilamentUser;
5+
use Illuminate\Foundation\Auth\User;
66
use Illuminate\Queue\SerializesModels;
77

88
class RecoveryCodeReplaced
99
{
1010
use SerializesModels;
1111

12-
/**
13-
* The authenticated user.
14-
*/
15-
public FilamentUser $user;
16-
17-
/**
18-
* The recovery code.
19-
*/
20-
public string $code;
21-
2212
/**
2313
* Create a new event instance.
2414
*/
25-
public function __construct(FilamentUser $user, string $code)
26-
{
27-
$this->user = $user;
28-
$this->code = $code;
29-
}
15+
public function __construct(public User $user, public string $code) {}
3016
}

src/Events/RecoveryCodesGenerated.php

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,15 @@
22

33
namespace Stephenjude\FilamentTwoFactorAuthentication\Events;
44

5-
use Filament\Models\Contracts\FilamentUser;
5+
use Illuminate\Foundation\Auth\User;
66
use Illuminate\Foundation\Events\Dispatchable;
77

88
class RecoveryCodesGenerated
99
{
1010
use Dispatchable;
1111

12-
/**
13-
* The user instance.
14-
*/
15-
public FilamentUser $user;
16-
1712
/**
1813
* Create a new event instance.
1914
*/
20-
public function __construct(FilamentUser $user)
21-
{
22-
$this->user = $user;
23-
}
15+
public function __construct(public User $user) {}
2416
}

src/Events/TwoFactorAuthenticationEvent.php

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,15 @@
22

33
namespace Stephenjude\FilamentTwoFactorAuthentication\Events;
44

5-
use Filament\Models\Contracts\FilamentUser;
5+
use Illuminate\Foundation\Auth\User;
66
use Illuminate\Foundation\Events\Dispatchable;
77

88
abstract class TwoFactorAuthenticationEvent
99
{
1010
use Dispatchable;
1111

12-
/**
13-
* The user instance.
14-
*/
15-
public $user;
16-
1712
/**
1813
* Create a new event instance.
1914
*/
20-
public function __construct(FilamentUser $user)
21-
{
22-
$this->user = $user;
23-
}
15+
public function __construct(public User $user) {}
2416
}

0 commit comments

Comments
 (0)