简体   繁体   中英

why email notification in laravel doesn't work?

I have a simple dashboard to add companies and their employees, i want to send an email notification to admin if there is a new company added, and send an email to company when new employee added. how to do this using laravel?

i tried to use laravel notification as documentation, but it didn't work.

Maybe some piece of code from your project would be help us to understand.

I think the answer you looking for is can be boot method in model. If you want to check that is there any new company? Then, go to your Company model and try something like this.

public static function boot(){
     static::creating(function ($model) {
     /*add code about what do you want to do.
     Maybe notify method like this  */
    $model->notify(new NewMessage($variable ));
    });

I am really sorry if I got you wrong, but i am just trying to help you.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM