I use a Lumen Laravel-based framework and it allows me to create custom method like this:
/**there should be a proper doc*/
\Laravel\Lumen\Http\ResponseFactory::macro('customMethod', function ()
{
return $this;
});
It creates method customMethod
called as method which belongs response()
function.
/**or probably there should be a proper doc*/
return response()->customMethod()
I want to make a hint to my IDE (PhpStorm 2020.1.2) which allows it to see reference from where customMethod
is called to where it is declared, and follow it with click on function name in IDE.