Skip to content

Laravel MultiLang simplifies multilingual content management, allowing dynamic language switching for an enhanced user experience. Streamline translation integration effortlessly with this Laravel package.

Notifications You must be signed in to change notification settings

natthasath/demo-laravel-multi-lang

Repository files navigation

🎉 DEMO Laravel Multi Lang

Laravel MultiLang simplifies multilingual content management, allowing dynamic language switching for an enhanced user experience. Streamline translation integration effortlessly with this Laravel package.

version rating uptime

🚀 Setup

  • Install Package
composer require outhebox/blade-flags
php artisan vendor:publish --tag=blade-flags-config
  • Use Directory
/lang
    /en
        messages.php
    /es
        messages.php
  • Use JSON
/lang
    en.json
    es.json
  • Set Locale Configuration
'locale' => 'en',
'fallback_locale' => 'en',
  • Check Locale in Route
Route::get('/greeting/{locale}', function ($locale) {
    if (! in_array($locale, ['en', 'th'])) {
        abort(400);
    }

    App::setLocale($locale);

    $locale = App::currentLocale();
    print($locale);
});
  • Create Migration User Table
php artisan make:migration create_users_table --create=users
php artisan migrate
php artisan make:model Models\\User

🏆 Run

npm run dev
php artisan serve

About

Laravel MultiLang simplifies multilingual content management, allowing dynamic language switching for an enhanced user experience. Streamline translation integration effortlessly with this Laravel package.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages