Notify super admins on new user registration (bell + email)
When a new user registers, all super_admin users receive:
- A database notification shown in the bell (type: new_user), with the
new user's avatar and a link to their channel
- An email congratulating them with the new member's name, email,
join date, gender, and nationality, plus a View Profile CTA
Notification rendering in app.blade.php refactored into notifHref() and
notifThumb() helpers so new_user notifications link to /channel/{slug}
and show a circular avatar instead of a video thumbnail. Also fixed the
legacy /storage/thumbnails/ path to /media/thumbnails/ for video notifications.
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
This commit is contained in:
1 parent
4887d0c517
commit
3fe167e33f
4 files changed
+116
-6
No files matched your search
@@ -4,6 +4,7 @@ namespace App\Http\Controllers\Auth;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\User;
|
||||
use App\Notifications\NewUserRegistered;
|
||||
use App\Rules\NotDisposableEmail;
|
||||
use Illuminate\Auth\Events\Registered;
|
||||
use Illuminate\Http\Request;
|
||||
@@ -45,6 +46,11 @@ class RegisteredUserController extends Controller
|
||||
|
||||
event(new Registered($user));
|
||||
|
||||
// Notify all super admins of the new registration
|
||||
User::where('role', 'super_admin')->each(function (User $admin) use ($user) {
|
||||
$admin->notify(new NewUserRegistered($user));
|
||||
});
|
||||
|
||||
auth()->login($user);
|
||||
|
||||
return redirect()->route('verification.notice');
|
||||
|
||||
Reference in new issue
Block a user