2017 © Pedro Peláez
 

plugin language-switcher

Create a language switcher for your Laravel 5.5 app, straight from the command line

image

mikehins/language-switcher

Create a language switcher for your Laravel 5.5 app, straight from the command line

  • Saturday, February 24, 2018
  • by mikehins
  • Repository
  • 1 Watchers
  • 4 Stars
  • 94 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 2 Open issues
  • 5 Versions
  • 27 % Grown

The README.md

Latest Stable Version Total Downloads, (*1)

Laravel 7 ready

language-switcher

Create a language switcher for your Laravel 5.5+ app straight from the command line, (*2)

composer require mikehins/language-switcher

This command will add / remove a language switcher menu item in the main nav bar., (*3)

Alt text, (*4)

Important Laravel version 6 +

Be sure to run composer require laravel/ui and php artisan ui vue --auth before to run the command. You also have to run npm install && npm run dev, (*5)

Important before Laravel version 6.0

Be sure to run php artisan make:auth and php artisan migrate before to run the command, (*6)


To add the language switcher, (*7)

php artisan switch:add

To revert the changes, (*8)

php artisan switch:delete

This is what the command switch:add does : - Add a default_language field in your users table - Add the markup to the layouts/app.blade.php file - Add a route in the routes/web.php file - Add a Middleware inside app\Http\Middleware - Add the middleware to the app\Http\Kernel.php - Add a LanguageController in the app\Http\Controllers directory - Add a language file to the config directory config/languages.php, (*9)

When the user switch the language, it will automatically update the default_language field from the users table. The next time the user logs in, the language session will automatically be set by the middleware using the auth()->user()->default_language variable., (*10)

The Versions

24/02 2018

dev-master

9999999-dev

Create a language switcher for your Laravel 5.5 app, straight from the command line

  Sources   Download

MIT dbad

by Mike Hins

24/02 2018

2.0

2.0.0.0

Create a language switcher for your Laravel 5.5 app, straight from the command line

  Sources   Download

MIT

by Mike Hins

24/02 2018

2

2.0.0.0

Create a language switcher for your Laravel 5.5 app, straight from the command line

  Sources   Download

MIT

by Mike Hins

07/09 2017

1.0

1.0.0.0

Create a language switcher for your Laravel 5.5 app, straight from the command line

  Sources   Download

dbad

by Mike Hins

07/09 2017

1.0.1

1.0.1.0

Create a language switcher for your Laravel 5.5 app, straight from the command line

  Sources   Download

dbad

by Mike Hins