Here's how elixir() helper function is done, at vendor/laravel/framework/src/Illuminate/Foundation/helpers.php:
if ( ! function_exists('elixir'))
{
/**
* Get the path to a versioned Elixir file.
*
* @param string $file
* @return string
*/
function elixir($file)
{
static $manifest = null;
if (is_null($manifest))
{
$manifest = json_decode(file_get_contents(public_path().'/build/rev-manifest.json'), true);
}
if (isset($manifest[$file]))
{
return '/build/'.$manifest[$file];
}
throw new InvalidArgumentException("File {$file} not defined in asset manifest.");
}
}
Approach 1
As you can see, it only defines this function if it doesn't exists.
So one way to go about it would be to define it with your own custom code and make sure that composer autoloader loads it first. But, it can get a little bit trick, so I suggest another approach:
Approach 2
Create your own helper function (with another name)!
Just name it whatever you want, remove the two build references and use it. And also, make sure to check the original function from times to times to make sure that your code is compliant.