Skip to main content

Black Friday 2025! Only until December 1st: coupon FRIDAY25 for 40% off Yearly/Lifetime membership!

Read more here

LaraBug/larabug-app

218 stars
2 code files
View LaraBug/larabug-app on GitHub

app/Models/User.php

Open in GitHub
use Illuminate\Foundation\Auth\User as Authenticatable;
use App\Mail\User\WelcomeEmail;
 
class User extends Authenticatable
{
//
public static function boot()
{
parent::boot();
 
static::created(function ($user) {
\Mail::to($user)->send(new WelcomeEmail($user));
});
}
}

app/Mail/User/WelcomeEmail.php

Open in GitHub
use App\Models\User;
use Illuminate\Mail\Mailable;
 
class WelcomeEmail extends Mailable
{
public $user;
 
public function __construct(User $user)
{
$this->user = $user;
}
 
public function build()
{
return $this
->subject('Welcome to ' . config('app.name') . ' ?')
->markdown('emails.user.welcome');
}
}

We'd Love Your Feedback

Tell us what you like or what we can improve

Feel free to share anything you like or dislike about this page or the platform in general.