Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

jpcjr's avatar
Level 6

email validation outside of registration

Hello! I'm currently working with Backpack & PermissionsManager extension. There are two types of admin roles (admin and supplier). Only admins can create new users via the backend. When an admin creates a new supplier, I'd like to repurpose the email verification process to notify a supplier. Is this even possible? I'm new to Laravel, so if I'm missing something obvious I apologize in advance.

Here's what I've tried so far:

  1. extracted the UserCrudController out of vendor/backpack/permissionsmanager and moved into my Controllers.

  2. added MustVerifyEmail to my User model

  3. The Laravel email documentation mentions if you are manually implementing registration to use

  • use Illuminate\Auth\Events\Registered;

  • event(new Registered($user));

.... but I'm not sure where this is supposed to go. I thought it might be in the UserCrudController in the store() method, but I'm not having much luck with that.

Again, if I'm totally off the mark here, please let me know. Any suggestions or things to read up on are greatly appreciated.

0 likes
2 replies
danwah's avatar

Hey, I think you're almost there with what you've done.

I use the same process in my UserController@store method, albeit for an API.

add use Illuminate\Auth\Events\Registered; to the top of your UserCrudController

and after you've saved the user to your database or whatever you're using, call event(new Registered($user));

In your App\Models\User model, make sure you're using the following:

class User extends Authenticatable implements MustVerifyEmail
{
    use Notifiable;

Then you need to have your queue worker running to pick up the job to send out the verification email.

php artisan queue:listen - This lets you make code changes and not have to restart the queue each time. If you don't want that just use php artisan queue:work.

That should be it. This is using Laravel v8 but i believe the process is similar for older versions.

Hope that helps!

1 like
jpcjr's avatar
Level 6

Thanks @danwah! I was able to get it working. Now I need to work on the verification side of it, but I'll get there. I'm trying to wrap my head around some of the auth stuff.

Please or to participate in this conversation.