Laravel-snappy: Error "Class snappy.pdf does not exist"

Created on 16 Mar 2015  路  5Comments  路  Source: barryvdh/laravel-snappy

I followed all info in readme, added it as service and as facade.
I set correct path to binary.

No matter how i do i get the following error:
Class snappy.pdf does not exist (or Class.spanny.pdf.wrapper) does not exist.

What is it that i am missing?

My composer json is like this:

"require": {
"laravel/framework": "5.0._",
"barryvdh/laravel-snappy": "0.2._",
"h4cc/wkhtmltopdf-amd64": "0.12.2.1",
"h4cc/wkhtmltopdf-i386": "0.12.2.1",
"illuminate/html": "~5.0",
"knplabs/knp-snappy": "0.3.*"
},

my controller code for testing is:
return PDF::loadFile('http://www.github.com')->stream('github.pdf');

Most helpful comment

You are sure you added the ServiceProvider correctly?
Did you change the config?

Did you clear the cache (php artisan cache:clear), config (php artisan config:clear) and compiled filed (php artisan clear-compiled)?

All 5 comments

You are sure you added the ServiceProvider correctly?
Did you change the config?

Did you clear the cache (php artisan cache:clear), config (php artisan config:clear) and compiled filed (php artisan clear-compiled)?

Added to providers:
'Barryvdh\Snappy\ServiceProvider',

Added to aliases:
'PDF' => 'Barryvdh\Snappy\Facades\SnappyPdf',
'Image' => 'Barryvdh\Snappy\Facades\SnappyImage',

tried clearing all caches, no luck

In top of controller:
use PDF;
use Barryvdh\Snappy;

I restarted from scratch and this time it worked, so must have missed somehing. Thanks for an awesome project!

Was this page helpful?
0 / 5 - 0 ratings