Skip to content

Instantly share code, notes, and snippets.

@zabaala
Last active December 6, 2017 21:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zabaala/0fd6aae34a76b1230c495c6070e85d3f to your computer and use it in GitHub Desktop.
Save zabaala/0fd6aae34a76b1230c495c6070e85d3f to your computer and use it in GitHub Desktop.
<?php
# Ex 2
use App\Applications\Backend\Http\Controllers\ExampleController;
Route::get('/{locale}/hackaton', function (\Illuminate\Http\Request $request) {
App::setLocale($request->locale);
return app(ExampleController::class)->callAction('index', []);
});
<?php
// Ex #1
Route::group('/same-prefix/{locale}', function($locale){
App::setLocale($locale);
Route::get('/subscribers/{$subscriber}', ['uses' => 'SubscribersController@show']);
});
// non-translatable route...
Route::get('/contact', ['uses' => 'SiteController@contact']);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment