A lightweight Laravel project that demonstrates PDF generation (using packages like barryvdh/laravel-dompdf) and includes a simple web UI. This README explains how to get the project running locally and in Docker.
- Clone the repository
git clone <repo-url> laravel-pdf-generator
cd laravel-pdf-generator- Install PHP dependencies
composer install- Copy the environment file and set values
cp .env.example .env
# On Windows (PowerShell): Copy-Item .env.example .env- Serve the application
php artisan serve Open your browser at: http://127.0.0.1:8000
Run the test suite with:
php artisan testThis repository contains a Dockerfile. A simple way to build and run the image locally:
docker build -t laravel-pdf-generator .
docker run -it --rm -p 8000:8000 \
-e APP_ENV=local -e APP_KEY="base64:..." \
laravel-pdf-generator(Adjust environment variables and entrypoint as required; for production deployments prefer using a multi-stage build or Docker Compose.)
- If
composer installfails with memory errors, run:
COMPOSER_MEMORY_LIMIT=-1 composer install-
Ensure PHP extensions required by Laravel are installed (openssl, pdo, mbstring, tokenizer, xml, ctype, json, bcmath).
-
On Windows, if symlinks fail for
php artisan storage:link, create thestoragepublic folder manually or run your terminal as Administrator. -
If assets are not updating, try:
npm run dev
php artisan view:clear
php artisan route:clear
php artisan config:clear-
PDF generation uses
barryvdh/laravel-dompdf(already included incomposer.json). Checkresources/views/pdf/for example templates. -
Routes and controllers are located in
app/Http/Controllersand views are inresources/views.
Contributions are welcome — please open an issue or a pull request.
The Laravel framework is open-sourced software licensed under the MIT license.