Skip to content

Instantly share code, notes, and snippets.

@keevitaja
Created April 14, 2017 09:44
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 keevitaja/f96437d5a56dc7d39db0d3298badd366 to your computer and use it in GitHub Desktop.
Save keevitaja/f96437d5a56dc7d39db0d3298badd366 to your computer and use it in GitHub Desktop.
<?php namespace Keevitaja\TestModule;
use Closure;
use Illuminate\Http\Request;
use Illuminate\Translation\Translator;
class LoadTranslations
{
protected $trans;
public function __construct(Translator $trans)
{
$this->trans = $trans;
}
public function handle(Request $request, Closure $next)
{
$this->trans->addLines([
'message.logged_out' => 'testing'
], 'en', 'anomaly.module.users');
dd($this->trans->trans('anomaly.module.users::message.logged_out'));
return $next($request);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment