barryvdh / laravel-dompdf

A DOMPDF Wrapper for Laravel
MIT License
6.66k stars 966 forks source link

Installation instructions for registering service provider are incorrect #932

Closed mlambley closed 1 year ago

mlambley commented 1 year ago

Describe the bug Installation instructions are incorrect. Service providers are not registered in bootstrap/app.php

To Reproduce Steps to reproduce the behavior:

Expected behavior Error to not appear

Additional context Service providers should be wired up via config/app.php in the Package Service Providers... section, or alternatively in the AppServiceProvider register function. By loading them in bootstrap/app.php, the config object has not been loaded into the application yet.

/*
 * Package Service Providers...
 */
Barryvdh\DomPDF\ServiceProvider::class,
erikn69 commented 1 year ago

This is not a bug

You are reading Lumen instructions, not Laravel instructions, laravel uses autodiscover https://github.com/barryvdh/laravel-dompdf/blob/7516caab940796d31267da9b30b548a56bef50cb/readme.md?plain=1#L18-L25

mlambley commented 1 year ago

Notwithstanding the unnecessary smart-alec side commentary from this other fellow here, perhaps including full instructions in the Laravel section might help? Laravel did not autodiscover this for me, I had to include it in config/app.php

erikn69 commented 1 year ago

Laravel did not autodiscover this for me

Seems like a problem with your implementation, did you try ?

php artisan config:clear
composer update
systemsolutionweb commented 1 year ago

It's not a bug or an issue

mlambley commented 1 year ago

Would have appreciated the situation to be handled without the meme or the laugh emotes, but if you insist that no one else could possibly make that same mistake I'll not say another word on the topic.

emalsa commented 1 year ago

I fell into the same trap. Out of habit from other instruction, I only found the configuration steps for Laravel after looking up this issue. These are after the Using chapter.

Just my 49 cents.