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]: #3489

Closed
1 task done
saqlainkhadim opened this issue Jan 7, 2022 · 5 comments
Closed
1 task done

[Bug]: #3489

saqlainkhadim opened this issue Jan 7, 2022 · 5 comments
Labels

Comments

@saqlainkhadim
Copy link

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?

composer require maatwebsite/excel:*

What version of Laravel are you using?

8.78.1

What version of PHP are you using?

8.1.1

Describe your issue

now here when i run any artisan command an Error Occur :

Error

Call to undefined method Illuminate\Foundation\Application::share()

at D:\Saqlain Khadim\blog\vendor\maatwebsite\excel\src\Maatwebsite\Excel\ExcelServiceProvider.php:154
150▕ */
151▕ protected function bindClasses()
152▕ {
153▕ // Bind the format identifier
➜ 154▕ $this->app['excel.identifier'] = $this->app->share(function($app) {
155▕ return new FormatIdentifier($app['files']);
156▕ });
157▕ }
158▕
▕ }
158▕
��

1 D:\Saqlain Khadim\blog\vendor\maatwebsite\excel\src\Maatwebsite\Excel\ExcelServiceProvider.php:58
Maatwebsite\Excel\ExcelServiceProvider::bindClasses()

2 D:\Saqlain Khadim\blog\vendor\laravel\framework\src\Illuminate\Foundation\Application.php:682
Maatwebsite\Excel\ExcelServiceProvider::register()

Please Help .....

How can the issue be reproduced?

when i run in an laravel application
composer require maatwebsite/excel
installation failed requirements does not meet
then i run
composer require maatwebsite/excel :*
then i think its installed
then i open config/app.php file and add service provider and aliase.
config/app.php

'providers' => [

           ....

           Maatwebsite\Excel\ExcelServiceProvider::class,

],

'aliases' => [

           ....

           'Excel' => Maatwebsite\Excel\Facades\Excel::class,

],

What should be the expected behaviour?

I dont know

@patrickbrouwers
Copy link
Member

patrickbrouwers commented Jan 7, 2022

Seems you are somehow installing v2 of the package. Try composer require maatwebsite/excel without the :* and check why no dependency could be found. Probably because a PHP extension isn't installed, composer should tell you.

@saqlainkhadim
Copy link
Author

saqlainkhadim commented Jan 7, 2022 via email

@patrickbrouwers
Copy link
Member

phpoffice/phpspreadsheet[1.15.0, ..., 1.21.0] require ext-gd * -> it
is missing from your system. Install or enable PHP's gd extension.

@travis-eldy0122
Copy link

C:\xampp\htdocs\psu>composer require maatwebsite/excel
Using version ^3.1 for maatwebsite/excel
./composer.json has been updated
Running composer update maatwebsite/excel
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

Problem 1
- maatwebsite/excel[3.1.0, ..., 3.1.25] require php ^7.0 -> your php version (8.1.2) does not satisfy that requirement.
- maatwebsite/excel 3.1.26 requires phpoffice/phpspreadsheet ^1.15 -> found phpoffice/phpspreadsheet[1.15.0, ..., 1.22.0] but it conflicts with your root composer.json require (dev-NumberFormatMask-Helpers).
- maatwebsite/excel 3.1.27 requires phpoffice/phpspreadsheet ^1.16 -> found phpoffice/phpspreadsheet[1.16.0, ..., 1.22.0] but it conflicts with your root composer.json require (dev-NumberFormatMask-Helpers).
- maatwebsite/excel[3.1.28, ..., 3.1.30] require phpoffice/phpspreadsheet 1.16.* -> found phpoffice/phpspreadsheet[1.16.0] but it conflicts with your root composer.json require (dev-NumberFormatMask-Helpers).
- maatwebsite/excel[3.1.31, ..., 3.1.x-dev] require phpoffice/phpspreadsheet ^1.18 -> found phpoffice/phpspreadsheet[1.18.0, ..., 1.22.0] but it conflicts with your root composer.json require (dev-NumberFormatMask-Helpers).
- Root composer.json requires maatwebsite/excel ^3.1 -> satisfiable by maatwebsite/excel[3.1.0, ..., 3.1.x-dev].

Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.
You can also try re-running composer require with an explicit version constraint, e.g. "composer require maatwebsite/excel:*" to figure out if any version is installable, or "composer require maatwebsite/excel:^2.1" if you know which you need.

@PARVEZFCI
Copy link

Error

Call to undefined method Illuminate\Foundation\Application::share()

at D:\Xampp\htdocs\laravel-newsportal\vendor\maatwebsite\excel\src\Maatwebsite\Excel\ExcelServiceProvider.php:154
150▕ */
151▕ protected function bindClasses()
152▕ {
153▕ // Bind the format identifier
➜ 154▕ $this->app['excel.identifier'] = $this->app->share(function($app) {
155▕ return new FormatIdentifier($app['files']);
156▕ });
157▕ }
158▕

1 D:\Xampp\htdocs\laravel-newsportal\vendor\maatwebsite\excel\src\Maatwebsite\Excel\ExcelServiceProvider.php:58
Maatwebsite\Excel\ExcelServiceProvider::bindClasses()

2 D:\Xampp\htdocs\laravel-newsportal\vendor\laravel\framework\src\Illuminate\Foundation\Application.php:682
Maatwebsite\Excel\ExcelServiceProvider::register()

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

4 participants