rrylee
10/19/2015 - 8:02 AM

how to use laravel-lang

how to use laravel-lang

// routes.php
Route::get('/', function () {
    return view('welcome')->with('count', '1');
});

// greeing.php
return [
    'hello' => 'Hi, :name'
];

// welcome.php
{{ trans('greeting.hello', ['name' => $name]) }}

// messages.php
return [
    'message' => 'your have :count message|your have :count messages'
];

// welcome.blade.php
{{ Lang::choice('messages.message', $count, ['count' => $count]) }}