2017 © Pedro Peláez
 

library translatableroutes

Create translatable resource routes

image

doitonlinemedia/translatableroutes

Create translatable resource routes

  • Saturday, January 23, 2016
  • by timvanuum
  • Repository
  • 2 Watchers
  • 3 Stars
  • 124 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 4 % Grown

The README.md

TranslatableRoutes

Create translatable resource routes for laravel, (*1)

Installation

Run the following command:, (*2)

composer require doitonlinemedia/translatableroutes "dev-master", (*3)

Next add the following provider to your app.php in the config folder under 'providers':, (*4)

Doitonlinemedia\Translatableroutes\TranslatableRoutesServiceProvider::class, (*5)

And add this line to 'aliases' in the same file:, (*6)

'TranslatableRoute' => Doitonlinemedia\Translatableroutes\TranslatableRouteFacade::class, (*7)

Finally run composer dump-autoload, (*8)

Usage

From now on you can use it like this in your route file:, (*9)

TranslatableRoute::resource('recipe', 'recepten', 'RecipeController');, (*10)

Grouping these routes still works!, (*11)

You can also use it like:, (*12)

TranslatableRoute::resource('recipe', trans('routes.recipes'), 'RecipeController');, (*13)

This way you will have different routes in different language, but always named the same. So if you use route('recipe.index') you'll always return the to the right page no matter what language., (*14)

Do not forget to set your locale to specific language you need e.g. \App::setLocale('nl'), (*15)

Result

Alt text, (*16)

Expansion

For now this package supports the English (default) and Dutch language., (*17)

The Versions

23/01 2016

dev-master

9999999-dev

Create translatable resource routes

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

by Tim van Uum

23/01 2016

1.0

1.0.0.0

Create translatable resource routes

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

by Tim van Uum