Last active
December 6, 2017 21:33
-
-
Save zabaala/0fd6aae34a76b1230c495c6070e85d3f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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', []); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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