How can I overwrite method “__(”?

136 Views Asked by At

In laravel using location method __(, like :

$managerAccessText = __('common.As you have manager access');

I got text

common.As you have manager access

in case if this label was not found

How can I overwrite method __( if i want to remove file name like in case above?

"laravel/framework": "^9.19",
1

There are 1 best solutions below

0
On BEST ANSWER

You understand that this function is for the international translation of strings according to the current locale of the application.

Unless you provide specific translation then the string will be output exactly as provided.

https://laravel.com/docs/9.x/localization#retrieving-translation-strings

You can include placeholders in the string where values passed to the function will be inserted into the translated string.

https://laravel.com/docs/9.x/localization#replacing-parameters-in-translation-strings