{"repo":"chinleung/laravel-multilingual-routes","free":true,"listed":false,"github":"https://github.com/chinleung/laravel-multilingual-routes","clone":"git clone https://github.com/chinleung/laravel-multilingual-routes.git","description":"A package to handle multilingual routes in your Laravel application.","language":"PHP","stars":448,"topics":["laravel","package","localization","composer-package","laravel-multilingual-routes","laravel-routes","laravel-package","hacktoberfest"],"license":"MIT","category":"api-integrations-sdks","readme_excerpt":"Laravel Multilingual Routes A package to register multilingual routes for your application. Versioning Version Laravel Version ------------- ------------- v6 13.x v5 12.x v4 10.x, 11.x v3 9.x v2 Older than 9.x Installation You can install the package via composer: To detect and change the locale of the application based on the request automatically, you can add the middleware to your bootstrap/app.php . It must be the first item in the web middleware group. Configuration By default, the application locales are only going to be en and the default locale is not prefixed. If you want to prefix the default locale, please run the following command to publish the configuration file: If your application supports different locales, you can either set a app.locales configuration or follow the configuration instructions from chinleung/laravel-locales. Example Instead of doing this: You can accomplish the same result with: A demo repository has been setup to showcase the basic usage of the package. Usage Quick Usage Once you have configured the locales, you can start adding routes like the following example in your routes/web.php : This will generate the following: Method URI Name Action ---------- --------- --------- ------------------------------------- GET\\ HEAD test en.test App\\Http\\Controllers\\TestController GET\\ HEAD fr/teste fr.test App\\Http\\Controllers\\TestController Note the URI column is generated from a translation file located at resources/lang/{locale}/routes.php which cont","default_branch":null,"files":null,"tree":[],"storefront":"/r/chinleung","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/chinleung/laravel-multilingual-routes/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}