Skip to content

Commit 29bf333

Browse files
authored
Merge pull request #4875 from derekmd/correct-mail-set-locale-code-snippet
[5.7] Correct Mail set locale code snippet
2 parents 9d34028 + a5a0350 commit 29bf333

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

mail.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -617,10 +617,10 @@ If you have mailable classes that you want to always be queued, you may implemen
617617

618618
Laravel allows you to send mailables in a locale other than the current language, and will even remember this locale if the mail is queued.
619619

620-
To accomplish this, the `Illuminate\Mail\Mailable` class offers a `locale` method to set the desired language. The application will change into this locale when the mailable is being formatted and then revert back to the previous locale when formatting is complete:
620+
To accomplish this, the `Mail` facade offers a `locale` method to set the desired language. The application will change into this locale when the mailable is being formatted and then revert back to the previous locale when formatting is complete:
621621

622-
Mail::to($request->user())->send(
623-
(new OrderShipped($order))->locale('es')
622+
Mail::to($request->user())->locale('es')->send(
623+
new OrderShipped($order)
624624
);
625625

626626
### User Preferred Locales

0 commit comments

Comments
 (0)