Reputation: 11
I want to use Laravel Lang method in with parameters. But it is giving error.
return view('backoffice/index')
->with('orderstatus','{{Lang::get('saide.version')}}')
->with('paymentstatus',Lang::get('saide.version'));
How can i solve this problem ??
Errors Class 'App\Http\Controllers\Lang' not found
Upvotes: 0
Views: 67
Reputation: 628
return view('backoffice/index')
->with('orderstatus', \Lang::get('saide.version') )
->with('paymentstatus', \Lang::get('saide.version') );
Try the above one. You don't use '{{ }}'
when you are in controller.
\Lang::get('saide.version')
this will return the string and it will set the string value to orderstatus
. Which will pass to the blade file
Upvotes: 1