Skip to content

Commit 9d25591

Browse files
Merge pull request #3 from anomalylabs/2.6
Sync
2 parents c9d29b6 + ce39ee8 commit 9d25591

24 files changed

+52
-59
lines changed

docs/en/04.extensions/02.authenticators.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ The extension you create must extend the `\Anomaly\UsersModule\User\Authenticato
117117
*/
118118
public function authenticate(array $credentials)
119119
{
120-
return $this->dispatch(new AuthenticateCredentials($credentials));
120+
return dispatch_sync(new AuthenticateCredentials($credentials));
121121
}
122122
}
123123

@@ -129,7 +129,7 @@ The primary task of any authenticators is to authenticate a login request. In th
129129

130130
public function authenticate(array $credentials)
131131
{
132-
return $this->dispatch(new AuthenticateCredentials($credentials));
132+
return dispatch_sync(new AuthenticateCredentials($credentials));
133133
}
134134

135135
Our `AuthenticateCredentials` command is responsible for the actual work:

docs/en/04.extensions/03.security-checks.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ The extension you create must extend the `\Anomaly\UsersModule\User\Security\Sec
128128
return true;
129129
}
130130

131-
return $this->dispatch(new CheckUser($user));
131+
return dispatch_sync(new CheckUser($user));
132132
}
133133

134134
}
@@ -145,7 +145,7 @@ The primary task of any security check is to validate a user. In this example we
145145
return true;
146146
}
147147

148-
return $this->dispatch(new CheckUser($user));
148+
return dispatch_sync(new CheckUser($user));
149149
}
150150

151151
Our `CheckUser` command is responsible for the actual work:

migrations/2019_01_10_202632_anomaly.module.users__add_str_id_to_users.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ public function up()
6060
* Ensure the potentially newly generated
6161
* models are autoloaded so we can use them.
6262
*/
63-
$this->dispatchNow(new AutoloadEntryModels());
64-
63+
dispatch_sync(new AutoloadEntryModels());
64+
6565
/**
6666
* Load the concrete on purpose.
6767
*

src/Http/Controller/RegisterController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public function register(Translator $translator)
3737
*/
3838
public function activate()
3939
{
40-
if (!$this->dispatch(new HandleActivateRequest())) {
40+
if (!dispatch_sync(new HandleActivateRequest())) {
4141

4242
$this->messages->error('anomaly.module.users::error.activate_user');
4343

src/User/Command/SendActivationEmail.php

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

33
use Anomaly\UsersModule\User\Contract\UserInterface;
44
use Anomaly\UsersModule\User\Notification\ActivateYourAccount;
5-
use Illuminate\Contracts\Config\Repository;
6-
use Illuminate\Foundation\Bus\DispatchesJobs;
7-
use Illuminate\Mail\Mailer;
8-
use Illuminate\Mail\Message;
95

106
class SendActivationEmail
117
{
12-
use DispatchesJobs;
13-
148
/**
159
* The user instance.
1610
*

src/User/Command/SendUserRegisteredEmail.php

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

33
use Anomaly\UsersModule\User\Contract\UserInterface;
44
use Anomaly\UsersModule\User\Notification\ActivateYourAccount;
5-
use Illuminate\Foundation\Bus\DispatchesJobs;
65

76
/**
87
* Class SendUserRegisteredEmail
@@ -13,9 +12,6 @@
1312
*/
1413
class SendUserRegisteredEmail
1514
{
16-
17-
use DispatchesJobs;
18-
1915
/**
2016
* The user instance.
2117
*

src/User/Notification/ActivateYourAccount.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,10 @@ public function toMail(UserInterface $notifiable)
5656
{
5757
$data = $notifiable->toArray();
5858

59+
if (isset($data['roles'])) {
60+
unset($data['roles']);
61+
}
62+
5963
return (new MailMessage())
6064
->view('anomaly.module.users::notifications.activate_your_account')
6165
->subject(trans('anomaly.module.users::notification.activate_your_account.subject', $data))

src/User/Notification/PasswordInvalidated.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,10 @@ public function toMail(UserInterface $notifiable)
5656
{
5757
$data = $notifiable->toArray();
5858

59+
if (isset($data['roles'])) {
60+
unset($data['roles']);
61+
}
62+
5963
return (new MailMessage())
6064
->error()
6165
->view('anomaly.module.users::notifications.password_invalidated')

src/User/Notification/ResetYourPassword.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,10 @@ public function via(UserInterface $notifiable)
5555
public function toMail(UserInterface $notifiable)
5656
{
5757
$data = $notifiable->toArray();
58+
59+
if (isset($data['roles'])) {
60+
unset($data['roles']);
61+
}
5862

5963
return (new MailMessage())
6064
->error()

src/User/Notification/UserHasBeenActivated.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ public function toMail(UserInterface $notifiable)
3939
{
4040
$data = $notifiable->toArray();
4141

42+
if (isset($data['roles'])) {
43+
unset($data['roles']);
44+
}
45+
4246
return (new MailMessage())
4347
->view('anomaly.module.users::notifications.user_has_been_activated')
4448
->subject(trans('anomaly.module.users::notification.user_has_been_activated.subject', $data))

0 commit comments

Comments
 (0)