Laravel 11: Build a Multi-Locale App That Speaks Your Users' Language
Автор: code with SJM
Загружено: 26 нояб. 2024 г.
Просмотров: 1 870 просмотров
Learn how to implement localization in Laravel 11! 🌐
In this tutorial, I'll walk you through step-by-step on how to switch languages dynamically in a Laravel app using cookies for persisting user preferences.
👇🔊 Important thing to understand:
Cookies vs. Database:
Cookies are lightweight and store the preference directly in the browser. They’re ideal for users who aren’t logged in.
Database is persistent and user-specific, making it suitable for logged-in users.
We'll cover middleware setup, route creation, controller logic, and language files, ensuring a seamless multilingual user experience.
Perfect for beginners and pros alike looking to add localization to their web applications! 🚀
Timestamps
0:00 Introduction
3:08 Laravel 11 project setup
5:00 Language files creation and customization
10:44 Language middleware creation and setup
13:13 Storing / persisting Locale using Cookies
20:50 Testing your locale / language to your blade files or views
22:51 Creating Language switching Controller file and set locale in your cookie's key
27:41 Setup Language switching route
29:19 Customizing your views to show Language changes / switching capabilities
41:42 Storing user language preferences in database
useful links:
https://laravel.com/docs/11.x/localiz...
https://github.com/shadrackjm/laravel...
Don’t forget to like 👍, share 📢, and subscribe 🔔 for more Laravel tutorials!"

Доступные форматы для скачивания:
Скачать видео mp4
-
Информация по загрузке: