Lara_Love's avatar

what is best package Import Export Excell to laravel

hi all what is best package Import Export Excell to laravel 9 php > 8

it composer require maatwebsite/excel don't work

0 likes
9 replies
Lara_Love's avatar

@SilenceBringer

Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - laravel/pint is locked to version v1.2.0 and an update of this package was not requested.
    - laravel/pint v1.2.0 requires php ^8.0 -> your php version (7.3; overridden via config.platform, actual: 8.1.4) does not satisfy that requirement.
  Problem 2
    - nunomaduro/collision is locked to version v6.3.0 and an update of this package was not requested.
    - nunomaduro/collision v6.3.0 requires php ^8.0.0 -> your php version (7.3; overridden via config.platform, actual: 8.1.4) does not satisfy that requirement.
  Problem 3
    - spatie/laravel-ignition is locked to version 1.5.0 and an update of this package was not requested.
    - spatie/laravel-ignition 1.5.0 requires php ^8.0 -> your php version (7.3; overridden via config.platform, actual: 8.1.4) does not satisfy that requirement.
  Problem 4
    - phpoffice/phpspreadsheet[1.23.0, ..., 1.25.2] require ext-gd * -> it is missing from your system. Install or enable PHP's gd extension.
    - Root composer.json requires phpoffice/phpspreadsheet ^1.23 -> satisfiable by phpoffice/phpspreadsheet[1.23.0, ..., 1.25.2].

To enable extensions, verify that they are enabled in your .ini files:
    - C:\xampp\php\php.ini
You can also run `php --ini` in a terminal to see which files are used by PHP in CLI mode.
Alternatively, you can run Composer with `--ignore-platform-req=ext-gd` to temporarily ignore these required extensions.
You can also try re-running composer require with an explicit version constraint, e.g. "composer require phpoffice/phpspreadsheet:*" to figure out if any version is installable, or "composer require phpoffice/phpspreadsheet:^2.1" if you know which you need.


Sinnbeck's avatar
Sinnbeck
Best Answer
Level 102

@LoverCode It is a php module. Is the error on your hosted server ? If so you need to enable the php-gd extension there

1 like
Lara_Love's avatar

@Sinnbeck hello i solve it with i add

extension=gd;

after

;extension=pgsql ;extension=shmop

in php.ini xampp

then i restart xampp

and new error when i install it at end setup installing

> @php artisan package:discover --ansi

   Symfony\Component\ErrorHandler\Error\FatalError

  Declaration of Maatwebsite\Excel\Cache\MemoryCache::get($key, $default = null) must be compatible with Psr\SimpleCache\CacheInterface::get(string $key, mixed $default = null): mixed

  at G:\test\shop\vendor\maatwebsite\excel\src\Cache\MemoryCache.php:62
     58▕
     59▕     /**
     60▕      * {@inheritdoc}
     61▕      */
  ➜  62▕     public function get($key, $default = null)
     63▕     {
     64▕         if ($this->has($key)) {
     65▕             return $this->cache[$key];
     66▕         }


   Whoops\Exception\ErrorException

  Declaration of Maatwebsite\Excel\Cache\MemoryCache::get($key, $default = null) must be compatible with Psr\SimpleCache\CacheInterface::get(string $key, mixed $default = null): mixed

  at G:\test\shop\vendor\maatwebsite\excel\src\Cache\MemoryCache.php:62
     58▕
     59▕     /**
     60▕      * {@inheritdoc}
     61▕      */
  ➜  62▕     public function get($key, $default = null)
     63▕     {
     64▕         if ($this->has($key)) {
     65▕             return $this->cache[$key];
     66▕         }

  1   G:\test\shop\vendor\filp\whoops\src\Whoops\Run.php:486
      Whoops\Run::handleError("Declaration of Maatwebsite\Excel\Cache\MemoryCache::get($key, $default = null) must be compatible with Psr\SimpleCache\CacheInterface::get(string $key, mixed $default = null): mixed", "G:\test\shop\vendor\maatwebsite\excel\src\Cache\MemoryCache.php")

  2   [internal]:0
      Whoops\Run::handleShutdown()
PHP Fatal error:  Declaration of Maatwebsite\Excel\Cache\MemoryCache::get($key, $default = null) must be compatible with Psr\SimpleCache\CacheInterface::get(string $key, mixed $default = null): mixed in G:\test\shop\vendor\maatwebsite\excel\src\Cache\MemoryCache.php on line 62
Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 255
Lara_Love's avatar

then i use it

composer require psr/simple-cache:^1.0 maatwebsite/excel

and its ok

Lara_Love's avatar

command php -v : PHP 8.1.4 (built: Mar 16 2022 09:33:31)

Lara_Love's avatar

i am on windows download php and try for it . but not solved.Tomorrow, we will make a way. thank you for help

Please or to participate in this conversation.