Courses

Multi-Language Laravel: All You Need to Know

Adding a language selector is crucial to any multilingual application. In this practical example, we'll add a language selector to our navigation bar:

In this first example, we will define the language from the URL segment, like /en/about or /es/register.


Setup

Here's our plan to set up a language selector:

  • Configuration: add a language list to the config - this will be used to display the language selector
  • Middleware: Add a Middleware to handle language change and URL redirection
  • Routes: Modify Routes to use the Middleware
  • Views: Add a language selector to our Views
  • Redirects: Modify our redirects for authentication

Let's start with the configuration:...

This lesson is only for Premium Members.
Want to access all lessons of this course?

You also get:

  • 55 courses (987 lessons, 46 h 42 min total)
  • Premium tutorials
  • Access to repositories
  • Private Discord