Laravel5: How to use @lang in @section?

laravel

Solution

This works it seems, not sure if it's the smartest way to handle it though:

@section('pageTitle', trans('my_account.pageTitle') )

Problem

I normally set my page titles like this: ``` @section('pageTitle', 'Awesome Page') ``` I then wanted to change page title based on selected language and tried this: ``` @section('pageTitle', @lang('my_account.pageTitle')) ``` However, I get this error: ``` FatalErrorException in b159db713cb664ba091b07db738bd4c3748de1cb.php line 1: Call to undefined function lang() ``` What is the correct syntax?

Original source