Cansu Koç
Cansu Koç

Reputation: 11

In Laravel8 cant use Lang method

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

Answers (1)

Akhzar Javed
Akhzar Javed

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

Related Questions