Setup for Laravel Forge that worked for me #259
intrepidws
started this conversation in
General
Replies: 1 comment
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
This took awhile and it seems like many others have similar problems, so I wanted to share what I did that worked for me. I pulled little bits from a variety of places, which I will do my best to cite.
Setup for Local Development with Laravel Herd
This was pretty simple, I just followed these instructions from Spatie. I ran
npm install puppeteer
and it worked fine locally.Setup for Laravel Forge
This is where things got complicated and confusing.
node -v
to ensure that Node is installed and at least version 22BROWSERSHOT_CHROME_PATH="/home/forge/.cache/puppeteer/chrome/linux-137.0.7151.70/chrome-linux64/chrome"
Code Changes
Code changes are necessary only in Laravel Forge and not in local development, so whenever I call the
Pdf
facade, I use this code:Shout out this post by @RedskyThirty for the code changes. He seemed to have a longer term issue with them, but so far so good for me.
Beta Was this translation helpful? Give feedback.
All reactions