user4642001
user4642001

Reputation: 21

Laravel 4 Installing dompdf

How do I install Laravel DomPDF?

I updated my Laravel's composer.json from this:

"require": {
    "laravel/framework": "4.2.*",
    "maatwebsite/excel": " ~1.2.1"
},

To this:

"require": {
    "laravel/framework": "4.2.*",
    "maatwebsite/excel": " ~1.2.1",
    "barryvdh/laravel-dompdf": "0.5.*"
},

And then ran this command:

composer update barryvdh/laravel-dompdf": "0.5.*

But it always throws "don't install laravel 4.2" like that and the composer fails to update.

How can I fix this?

Upvotes: 1

Views: 2106

Answers (2)

Bogdan
Bogdan

Reputation: 44546

The very first line from the GitHub project page readme says:

DOMPDF Wrapper for Laravel 5

The second one states:

For Laravel 4.x, check the 0.4 branch!

Which means you need to add the 0.4.* version to you composer.json, for the package to work with Laravel 4:

"require": {
    "laravel/framework": "4.2.*",
    "maatwebsite/excel": " ~1.2.1",
    "barryvdh/laravel-dompdf": "0.4.*"
},

Upvotes: 1

hasan movahed
hasan movahed

Reputation: 364

change this line

"barryvdh/laravel-dompdf": "0.4"

you not use packege laravel 5 for laravel 4

Upvotes: 0

Related Questions