skip to Main Content

Laravel – how to fix model boot method not working properly?

protected static function boot() { parent::boot(); self::creating(function ($model) { $model->unique_id = self::generateUniqueId(); }); self::deleting(function (Submission $submission) { Log::info('Deleting model:', ['model' => $submission]); dd($submission); // Delete all associated media $submission->clearMediaCollection('files'); $submission->clearMediaCollection('images'); }); } i have this method in my submission model…

VIEW QUESTION

Send email in Laravel 11

I would like to send an email using Laravel, but I am getting an error, I am sending it this way: UsersController.php .... $user_created = (new UserCreated($user)) ->onQueue('emails')->afterCommit(); Mail::to($user->email) ->queue($user_created); ..... This is the mailable: UserCreated.php <?php namespace AppMail; use…

VIEW QUESTION
Back To Top
Search