You want to see how a language key expands into its components.
This method will return an array with three elements:
- The first element is the key's namespace
- The second is the key's group (aka file)
- The third element is the actual item in the group
Consider the following PHP code.
print_r(Lang::parseKey('message.welcome')); print_r(Lang::parseKey('message.two.part')); print_r(Lang::parseKey('mypackage::message.two.part'));
The above code would output the following.
Array (  => *  => message  => welcome ) Array (  => *  => message  => two.part ) Array (  => mypackage  => message  => two.part )
This is a low-level method.
It's used internally by the
Lang facade. But it is handy to know when debugging and trying to determine why a translation string isn't finding the message. Knowing how the key is broken apart helps track down where Laravel is looking for the translation.