php - Laravel 5 Lang::get() Replace -


i'm having problems.

you can use lang :: () in laravel 5, want make replace characters.

resources/lang/en/messages.php

<?php     return array(     'test' => 'test message. :name', 

views/top.blade.php

{!! app::setlocale('en') !!} {!! lang::get('messages.test', array('name' => 'dayle')) !!} 

however, error.

errorexception in translator.php line 148: missing argument 2 illuminate\translation\translator::illuminate\translation\{closure}(), called in /home/my-site/www/my-site/vendor/compiled.php on line 11547 , defined (view: /home/my-site/www/my-site/resources/views/top.blade.php) 

cause not know.

do not people know?

i resolve issue following steps here

to summarize, try following steps:

  1. delete vendor/compiled.php , storage/framework/compiled.php
  2. run composer update , if didn't run automatically, run php artisan optimise compile again.
  3. use double quotes in messages.php file (e.g. "title" => "value in double qoutes")
  4. run composer dump-autoload -o

Popular posts from this blog

c# - ODP.NET Oracle.ManagedDataAccess causes ORA-12537 network session end of file -

matlab - Compression and Decompression of ECG Signal using HUFFMAN ALGORITHM -

utf 8 - split utf-8 string into bytes in python -