Answers for "Parameters inside Laravel localized string"

PHP
0

Parameters inside Laravel localized string

Laravel message localization uses named, not numeric, parameters.

Rewriting your example message:

'string1' => 'Welcome :user, Please meet :other',
You can now use, for example:

trans('string1', [ 'user' => 'Ainsley', 'other' => 'Hayden' ]);
Posted by: Guest on July-08-2021

Code answers related to "Parameters inside Laravel localized string"

Browse Popular Code Answers by Language