Skip to content
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

[Bug]: "Call to undefined function Maatwebsite\\Excel\\resolve()" #4083

Closed
1 task done
hanzz96 opened this issue Feb 5, 2024 · 2 comments
Closed
1 task done

[Bug]: "Call to undefined function Maatwebsite\\Excel\\resolve()" #4083

hanzz96 opened this issue Feb 5, 2024 · 2 comments
Labels

Comments

@hanzz96
Copy link

hanzz96 commented Feb 5, 2024

Is the bug applicable and reproducable to the latest version of the package and hasn't it been reported before?

  • Yes, it's still reproducable

What version of Laravel Excel are you using?

3.1.52

What version of Laravel are you using?

6.0.x

What version of PHP are you using?

7.4.3

Describe your issue

after composer update the project i can't use the library when importing file excel.
got error "Call to undefined function Maatwebsite\Excel\resolve()"
untitled

How can the issue be reproduced?

  • Import file excel.

What should be the expected behaviour?

before composer update, i'm trying install specific version 3.1.47 and it work when importing file xlsx.

@hanzz96 hanzz96 added the bug label Feb 5, 2024
@hanzz96
Copy link
Author

hanzz96 commented Feb 5, 2024

Hi, just found out that in 3.1.52 using function resolve() which is not (i think) available in laravel/lumen-framework 6
image

this error can be fixed somehow with import a new function resolve(), because in older laravel, function resolve() is not registered yet in helpers.php (laravel helper).
for now i registered it in my own helper and do composer dump-autoload, maybe it helps for other who experience it.
maybe the owner of this library can confirm it.

if (! function_exists('resolve')) {
    /**
     * Resolve a service from the container.
     *
     * @param  string  $name
     * @param  array  $parameters
     * @return mixed
     */
    function resolve($name, array $parameters = [])
    {
        return app($name, $parameters);
    }
}

@patrickbrouwers
Copy link
Member

I don't really support Lumen with this package, only on best effort basis as I don't have automated tests for Lumen. I've updated the resolve helper to app, but I don't know if there's more things that don't work correctly with Lumen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants