Oops, I do not know if it's possible to do what I want, but come on:
I have an api in lumen which basically read a specific header from the request and parse it into a YAML file and transforms it into an array, but as I use it in several different controllers and classes I've done a function that gets this header and returns the array, but I'm having to repeat this in every controller / class, what I want is:
Turn this "function" into something global so I can call any method / class type like this:
public function verifyemail(Cliente $cliente) {
$email = $cliente->email
}
Where the client is the function that returns the array.
Type as app () that I can use anywhere:
app()->environment() == 'development'
I think I was clear, if not, ask me.