Skip to content

Commit

Permalink
Merge pull request #4875 from derekmd/correct-mail-set-locale-code-sn…
Browse files Browse the repository at this point in the history
…ippet

[5.7] Correct Mail set locale code snippet
  • Loading branch information
taylorotwell authored Jan 1, 2019
2 parents 9d34028 + a5a0350 commit 29bf333
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions mail.md
Original file line number Diff line number Diff line change
Expand Up @@ -617,10 +617,10 @@ If you have mailable classes that you want to always be queued, you may implemen

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.

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:
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:

Mail::to($request->user())->send(
(new OrderShipped($order))->locale('es')
Mail::to($request->user())->locale('es')->send(
new OrderShipped($order)
);

### User Preferred Locales
Expand Down

0 comments on commit 29bf333

Please sign in to comment.