Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added info for using laravel-snappy in Homestead #108

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,21 @@ You can optionally use the facade for shorter code. Add this to your facades:
You can publish the config-file to change some settings (default paper etc).

php artisan vendor:publish

#### Homestead

If you are using homestead for your Laravel development you might have the problem that the shipped version of wkhtmltopdf for Ubuntu is compiled with the need for an installed x-server.

However to avoid installing a complet x-server in your Homestead enviroment you could use xvfb (X virtual framebuffer).

Steps to setup wkhtmltopdf in Homestead with xvfb:

1. `apt-get install wkhtmltopdf`
2. `apt-get install xvfb`
3. `echo -e '#!/bin/bash\nxvfb-run -a --server-args="-screen 0, 1920x1080x24" /usr/bin/wkhtmltopdf -q $*' > /usr/bin/wkhtmltopdf.sh; chmod a+x /usr/bin/wkhtmltopdf.sh; ln -s /usr/bin/wkhtmltopdf.sh /usr/local/bin/wkhtmltopdf`
4. Test out making a PDF file: `wkhtmltopdf https://www.google.com google.pdf` (This should leave you with a PDF file of the google frontpage).

You should now be able to use wkhtmltopdf/laravel-snappy in Homestead without installing a complete x-server.

### Lumen
In `bootstrap/app.php` add:
Expand Down