In translation files (resources/lang
), you can specify variables not only as :variable
, but also capitalized as :VARIABLE
or :Variable
- and then whatever value you pass - will be also capitalized automatically.
1// resources/lang/en/messages.php2'welcome' => 'Welcome, :Name'3 4// Result: "Welcome, Taylor"5echo __('messages.welcome', ['name' => 'taylor']);