Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

matus's avatar

Package - custom methods

Hello,

I have got an application with multi-language support. I use mcamara/laravel-localization package which is quite good.

In my app I want to display a country flag of a currently used language. I created my custom method which I put inside the class with other helper methods which come out of the box. However, when I deploy my app on Forge and download composer dependencies my custom method which I do need is not there because I just added it on my local machine.

I tried to create a custom helper function, however I was not able to make it work as it did when I put it to the original class.

This is my method which I do have in Mcamara\LaravelLocalization\LaravelLocalization class:

public function getCurrentLocateLink()
 {
    return $this->supportedLocales[ $this->getCurrentLocale() ][ 'link' ];
}

How would you solve the problem?

Thank you for any kind of help matus

0 likes
0 replies

Please or to participate in this conversation.