Search code examples
phplaravelhelperlaravel-5.6

Read config value from laravel helper


I'm trying to get a config value from my custom helper in laravel 5.6:

function current(string $conn=null){
    return $conn.config('server.current');
}

but I get this error:

Can't use function return value in write context in...

There is any other way to share it between helpers?

Laravel seems to not show config values in helpers.


Solution

  • current() is an existing function http://php.net/manual/en/function.current.php