|
@@ -3,6 +3,7 @@
|
|
namespace App\Http\Controllers\Auth;
|
|
namespace App\Http\Controllers\Auth;
|
|
|
|
|
|
use App\Http\Controllers\Controller;
|
|
use App\Http\Controllers\Controller;
|
|
|
|
+use App\Jobs\SubscribeToNewsletter;
|
|
use App\Recipient;
|
|
use App\Recipient;
|
|
use App\Rules\NotBlacklisted;
|
|
use App\Rules\NotBlacklisted;
|
|
use App\Rules\NotDeletedUsername;
|
|
use App\Rules\NotDeletedUsername;
|
|
@@ -63,6 +64,7 @@ class RegisterController extends Controller
|
|
],
|
|
],
|
|
'email' => ['required', 'email', 'max:254', 'confirmed'],
|
|
'email' => ['required', 'email', 'max:254', 'confirmed'],
|
|
'password' => ['required', 'min:8'],
|
|
'password' => ['required', 'min:8'],
|
|
|
|
+ 'newsletter' => ['nullable'],
|
|
'terms' => ['required', 'accepted']
|
|
'terms' => ['required', 'accepted']
|
|
]);
|
|
]);
|
|
}
|
|
}
|
|
@@ -82,6 +84,10 @@ class RegisterController extends Controller
|
|
'user_id' => $userId
|
|
'user_id' => $userId
|
|
]);
|
|
]);
|
|
|
|
|
|
|
|
+ if (isset($data['newsletter'])) {
|
|
|
|
+ SubscribeToNewsletter::dispatch($data['email']);
|
|
|
|
+ }
|
|
|
|
+
|
|
$twoFactor = app('pragmarx.google2fa');
|
|
$twoFactor = app('pragmarx.google2fa');
|
|
|
|
|
|
return User::create([
|
|
return User::create([
|