1

I was working with laravel 6 version. I tried to install mpdf package to create a "pdf download" option. I used composer require carlos-meneses/laravel-mpdf command. It didn't install the package and gave me this message

PackageManifest.php line 131 Undefined index:name

I had the same experience with installation of dompdf.

enter image description here

Finwe
  • 6,372
  • 2
  • 29
  • 44
Amatul Uzma
  • 29
  • 1
  • 3
  • Does this answer your question? [Laravel PackageManifest.php line 131: Undefined index: name](https://stackoverflow.com/questions/64620849/laravel-packagemanifest-php-line-131-undefined-index-name) – Finwe Feb 01 '21 at 13:16
  • @Finwe that post did not answer my question. Do you have any suggestions? I am on Laravel v8.9 and composer 2.0.13 – CodeConnoisseur May 14 '21 at 15:15
  • https://stackoverflow.com/questions/61177995/laravel-packagemanifest-php-undefined-index-name – Finwe May 14 '21 at 15:56

1 Answers1

8

this page

vendor/laravel/framework/src/Illuminate/Foundation/PackageManifest.php this line comment :

$packages = json_decode($this->files->get($path), true);

Add two lines:

$installed = json_decode($this->files->get($path), true);
$packages = $installed['packages'] ?? $installed;
Netwons
  • 1,170
  • 11
  • 14