-
-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Followed instructions, but also get "Call to undefined function app()" #17
Comments
Well, I have no clue how Composer's loader is supposed to work, but for whatever reason, when I install your package following your own instructions, the app prefers the …
if (! function_exists('svg_image')) {
function svg_image($name, $class = '', $attrs = [])
{
if (empty($name)) {
return;
}
// Add `App\` and `BladeSvgSage\` below to reference the other namespaces properly.
return App\sage(BladeSvgSage\BladeSvgSage::class)->svg($name, $class, $attrs);
}
}
… Hopefully this helps someone else who's trying to get this package to work. |
Working on a fix for this now. For some reason, I didn't run into this issue during initial testing prior to release. |
Should be fixed now in the v2.0.1 release. |
Thanks for your quick response, however I'm afraid this hasn't fixed the issue for me:
Reloading my page (which had been working fine with aforementioned hack) again reproduces that same error message:
I've reapplied my hack in order to continue development of my project. Happy to test again later. |
Are you calling the function directly or with the Blade directive? |
Just using the Blade directive. For example: |
Can you make sure the Blade cache is cleared? I see in your stack trace it's calling |
Good call, sorry about that. I was clearing my cache before but forgot to this time! Cheers, it works. |
Great! Thanks for testing. Let me know if you find any other issues. |
Similarly to the authors of #9 and #3, I too am getting
Call to undefined function app()
when I try to install your library and call@svg('some-svg')
in my code. Here's the full message:I have PHP 7.2, Sage 9.0.5, and Composer 1.7.3. As instructed, I ran
composer require log1x/blade-svg-sage
, and it installed version 0.3.0 of nothingworks/blade-svg and 2.0.0 of log2x/blade-svg-sage:I've even installed the
blade-generate
WP-CLI tool to make sure the Blade cache was clear and tried recompiling, but it insists on generating code that tries to call the undefined functionapp()
.Any idea what I've done wrong?
The text was updated successfully, but these errors were encountered: