diff options
Diffstat (limited to 'app/Http/Controllers/Auth/RegisteredUserController.php')
| -rw-r--r-- | app/Http/Controllers/Auth/RegisteredUserController.php | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/app/Http/Controllers/Auth/RegisteredUserController.php b/app/Http/Controllers/Auth/RegisteredUserController.php index 0739e2e..3878c06 100644 --- a/app/Http/Controllers/Auth/RegisteredUserController.php +++ b/app/Http/Controllers/Auth/RegisteredUserController.php @@ -11,6 +11,8 @@ use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Hash; use Illuminate\Validation\Rules; use Illuminate\View\View; +use Illuminate\Support\Facades\Notification; +use App\Notifications\NewUserNotification; class RegisteredUserController extends Controller { @@ -43,6 +45,14 @@ class RegisteredUserController extends Controller event(new Registered($user)); + // Notify admin of new registration + $adminEmail = config('app.admin_notify_email'); + if ($adminEmail) { + Notification::route('mail', $adminEmail)->notify( + new NewUserNotification($user) + ); + } + Auth::login($user); return redirect(route('dashboard', absolute: false)); |
