1

I am trying to make pdf using baaryvdh/dompdf in laravel but while installing the package using the command:

`composer require barryvdh/laravel-dompdf`

getting the error:

Using version ^0.9.0 for barryvdh/laravel-dompdf
./composer.json has been updated
Running composer update barryvdh/laravel-dompdf
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - laravel/ui[v3.0.0, ..., v3.2.0] require illuminate/console ^8.0 -> found illuminate/console[v8.0.0, ..., v8.36.2] but these were not loaded, likely because it conflicts with another require.
    - Root composer.json requires laravel/ui ^3.0 -> satisfiable by laravel/ui[v3.0.0, v3.1.0, v3.2.0].
mohsin
  • 11
  • 1
  • 3
  • 1
    Either use a compatible version of dompdf with your current version of laravel or you will need to upgrade your laravel project to latest version. – Akhtar Munir Apr 13 '21 at 07:37
  • how should i upgrade my laravel project so that web ui not get disturbed and everything work fine in the complete project as it is working now? – mohsin Apr 13 '21 at 07:40
  • 1
    If you're using laravel/ui 3 you need laravel 8 I don't think dompdf is related here, a pervious update might have left composer in an inconsistent state – apokryfos Apr 13 '21 at 08:35
  • composer is in an inconsistent state, no command is executing in the project. – mohsin Apr 13 '21 at 09:53
  • Either downgrade laravel ui or upgrade laravel (or delete vendor and composer.lock and try running `composer install` again) – apokryfos Apr 13 '21 at 11:47
  • Please share more details, like the current state of your `composer.json` and your attempts to resolve the problem – Nico Haase Apr 15 '21 at 12:50

1 Answers1

0

Run below command

composer require barryvdh/laravel-dompdf:0.8.5

But Remember above version needs, This package requires php ^7.1.3.

Because if will not pass version bydefault it will take latest version and the latest version of dompdf is supported with laravel 8 and laravel ui 3.x

or

Please run "Composer update" Command

And Then Run

composer require barryvdh/laravel-dompdf:0.8.5

Hope this will work for you.

Yudiz Solutions
  • 4,216
  • 2
  • 7
  • 21
  • Please add some explanation to your answer such that others can learn from it. Why should installing any specific version of `barryvdh/laravel-dompdf` solve the problem? – Nico Haase Apr 15 '21 at 12:51
  • Yes I have Already Mentioned ``Because if will not pass version byDefault it will take latest version and the latest version of Dompdf is supported with Laravel 8 and Laravel ui 3.x`` – Yudiz Solutions Apr 16 '21 at 05:26
  • Please share more details - the sole change in dependencies between v0.8.5 and v0.9.0 is that the later one supports more versions of Laravel (5.5 to 8). If Laravel v8 is used, instaling the older package won't work – Nico Haase Apr 16 '21 at 07:20