Skip to content

Commit 8461d4f

Browse files
authored
Merge pull request #78 from stephenjude/main
Add constructor property promotion support for events
2 parents 26f5c0d + 7699740 commit 8461d4f

File tree

4 files changed

+14
-36
lines changed

4 files changed

+14
-36
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@
22

33
All notable changes to `filament-two-factor-authentication` will be documented in this file.
44

5+
## 3.0.2 - 2025-08-17
6+
7+
### What's Changed
8+
9+
* Revert logout action deletion by @stephenjude in https://github.com/stephenjude/filament-two-factor-authentication/pull/77
10+
11+
**Full Changelog**: https://github.com/stephenjude/filament-two-factor-authentication/compare/3.0.1...3.0.2
12+
513
## 3.0.1 - 2025-08-16
614

715
### What's 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)