This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.

oly2554
oly2554

Hi,

I am trying to use barryvdh\dompdf with my October installation (I am developing a plugin that I want to use it with). I have used composer require to install which has put the files under the vendor directory. I have then added Barryvdh\DomPDF\ServiceProvider to config/app.php however I keep getting an error:

Symfony \ Component \ Debug \ Exception \ FatalErrorException (E_ERROR) Class 'Barryvdh\DomPDF\ServiceProvider' not found

I have followed the details posted by Flynsarmy in other posts as well as what else I could see. I suspect I am missing something obvious.

Any help/pointers you could offer would be great

Many Thanks

oly2554
oly2554

Ok I have tried several ways of getting this to detect the ServiceProvider and I have changed tack and am now trying to install it with my plugin. I've probably not provided enough info for anyone to help so I'll try again. In my Plugin.php file I have:

public function boot() {
App::register('Barryvdh\DomPDF\ServiceProvider'); $alias = AliasLoader::getInstance(); $alias->alias('PDF', 'Barryvdh\DomPDF\Facade'); }

and in my plugin directory i have installed the Dompdf plugin to: vendor/barryvdh/laravel-dompdf/

and the ServiceProvider.php file is located: vendor/barryvdh/laravel-dompdf/src/

Do I have to point October to where to look for the ServiceProvider or will it just mystically know?

Again thanks in advance for any help anyone can provide.

Keios
Keios

php artisan dump-autoload in first case of global project composer require, composer update & composer dump-autoload in plugin directory in second case.

oly2554
oly2554

Thanks VoipDeploy I had screwed up my composer.json (not really understanding how it all worked) your comment has made me go back and look at it and I have progress - the plugin is still not working but it has registered and now has a new error. But that I can work from.

In short many thanks for pointing me in the right direction.

jfo
jfo

Specifically to use DOMPDF with OctoberCMS this great plugin http://octobercms.com/plugin/renatio-dynamicpdf does that and more. It works like a charm!

1-5 of 5

You cannot edit posts or make replies: the forum has moved to talk.octobercms.com.