GithubHelp home page GithubHelp logo

laravel-domain-localization's Introduction

Laravel 5 domain localization

A tool for easy domain based localization in Laravel 5 applications.

Installation

This package is build for Laravel framework based applications.

Requirements

  • PHP >= 5.4.0
  • Laravel 5+

Composer installation

You must modify your composer.json file and run composer update to include the latest version of the package in your project:

"require": {
    "bastiendonjon/laravel-domain-localization": "1.0.*"
}

Or you can run the composer require command from your terminal:

composer require bastiendonjon/laravel-domain-localization:1.0.x

Service provider

Open app/config/app.php and register the required service provider.

'providers' => [
    BastienDonjon\LaravelDomainLocalization\Provider\DomainLocalizationServiceProvider:class,
]

Make config file :

php artisan vendor:publish"

Usage

Th Laravel Domain Localization get tld to switch locale. See config file to match tdl with locale.

For example, when you add the dutch locale fr the user could access two different locales, using the following addresses:

http://example.com
http://example.fr

laravel-domain-localization's People

Contributors

bastiendonjon avatar

Stargazers

Jérôme Coppée avatar  avatar

Watchers

James Cloos avatar  avatar Matheus Lima avatar

laravel-domain-localization's Issues

localized routes

Hi @bastiendonjon,

I have used this plugin in order to have localized according to domain, everything works fine, but I would like to have localized routes so domain.com/additional-info, domain.de/nachtrag, domain.fr/addendum

Do you know how can I archive this? I have tried something like:

Route::get('/'.trans('routing.additional-info'), ['middleware' => ['domain-localization'], function () {
return view('additionInfo');
}]);

However it doesn't work.

Thanks in advance.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.