{"id":36969556,"url":"https://github.com/traincase/laravel-pdf-tinker","last_synced_at":"2026-01-13T21:31:02.153Z","repository":{"id":52652853,"uuid":"242583805","full_name":"traincase/laravel-pdf-tinker","owner":"traincase","description":"Live tinkering with HTML templates for conversion to PDF.","archived":false,"fork":false,"pushed_at":"2025-09-01T12:34:23.000Z","size":896,"stargazers_count":44,"open_issues_count":0,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-10-02T01:21:22.894Z","etag":null,"topics":["html","laravel","pdf-generation","playground"],"latest_commit_sha":null,"homepage":"","language":"Blade","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/traincase.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2020-02-23T20:14:22.000Z","updated_at":"2025-09-01T12:33:43.000Z","dependencies_parsed_at":"2025-09-01T14:23:25.463Z","dependency_job_id":"a7e34158-525f-4545-8bf9-d4b20e59e2f9","html_url":"https://github.com/traincase/laravel-pdf-tinker","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/traincase/laravel-pdf-tinker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/traincase%2Flaravel-pdf-tinker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/traincase%2Flaravel-pdf-tinker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/traincase%2Flaravel-pdf-tinker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/traincase%2Flaravel-pdf-tinker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/traincase","download_url":"https://codeload.github.com/traincase/laravel-pdf-tinker/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/traincase%2Flaravel-pdf-tinker/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28400890,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-13T14:36:09.778Z","status":"ssl_error","status_checked_at":"2026-01-13T14:35:19.697Z","response_time":56,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["html","laravel","pdf-generation","playground"],"created_at":"2026-01-13T21:31:01.370Z","updated_at":"2026-01-13T21:31:02.147Z","avatar_url":"https://github.com/traincase.png","language":"Blade","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Laravel PDF Tinker\n\n**This package is meant as a tool for local development. Do not include this package in your production build.**\n\n[![Latest Version on Packagist](https://img.shields.io/packagist/v/traincase/laravel-pdf-tinker.svg?style=flat-square)](https://packagist.org/packages/traincase/laravel-pdf-tinker)\n[![Quality Score](https://img.shields.io/scrutinizer/g/traincase/laravel-pdf-tinker.svg?style=flat-square)](https://scrutinizer-ci.com/g/traincase/laravel-pdf-tinker)\n\nLaravel PDF Tinker gives you a quick interface to debug and fiddle with the creation of HTML templates that will be converted into PDF's.\n\nIf you're one of those guys that frequently has to create custom templates for every client (order confirmations, goods deliveries, invoices etc.) this package is for you.\n\n![alt text](https://github.com/traincase/laravel-pdf-tinker/raw/master/screenshot.png \"Screenshot of playground\")\n\n## Installation\nSince this package is only meant for during local development install this package as a development dependency.\n\n`composer require traincase/laravel-pdf-tinker --dev`\n\nThe package will automatically register it's service provider, if you [opted out of auto-discovery](https://laravel.com/docs/packages#package-discovery) add something along the lines of the following to a registered service provider (for example the `AppServiceProvider`):\n \n```php\n// Put this inside the 'register' method\nif ($this-\u003eapp-\u003eisLocal()) {\n    $this-\u003eregister(\\Traincase\\LaravelPdfTinker\\PdfTinkerServiceProvider::class);\n}\n```\n\nDon't forget to check [the drivers section](#drivers) to see if the driver you're planning to use requires any additional set-up.\n\n## Usage\nYou can find most options straight in the interface of the playground.\nChances are high you don't have to edit the configuration.\nNevertheless, there are a few things you can configure.\n\n### Configuration\n\n#### Route prefix\nThe service provider will register a few routes necessary to set up and run the playground.\nBy default the routes are all prefixed with `vendor/laravel-pdf-tinker`. \nThis means the playground is available at `your-app.tld/vendor/laravel-pdf-tinker/playground`.\n\nDo you have an unlikely collision with your routes? No worries!\n\nYou may publish the configuration file (`php artisan vendor:publish`) and edit the `route_prefix` key in `config/laravel-pdf-tinker.php` to use a different prefix of your liking.\n\n#### Driver options\nIf you published the configuration file you can also update the `default_driver_options.\u003cyour-driver-alias\u003e` key to set the default options that will be set in the interface (under Configuration \u003e Options).\nThis will just be used when you enter the playground, you can always update the configuration inside the playground.\nAny changes will not be persisted once you leave the page, so if you tinker a lot you might want to override the default options.\n\n### Drivers\nCurrently there are two drivers available. \n\n#### DomPDF\n[DomPdf](https://github.com/dompdf/dompdf) is the easiest driver to get started.\nEverything should already be in place after following the installation instructions. \n\nHappy tinkering! \n\n#### Wkhtmltopdf\nThe wkhtmltopdf driver needs the `wkhtmltopdf` executable to be available in your PATH.\nThis means that if you run `wkhtmltopdf --version` in a terminal it should output something like the following:\n\n```bash\n$ wkhtmltopdf --version\nwkhtmltopdf 0.12.5 (with patched qt)\n```\n\nIf you're using mac\u0026homebrew you can run `brew cask install wkhtmltopdf`. \nOn any other system download the binaries for your system from the [wkhtmltopdf website](https://wkhtmltopdf.org/downloads.html).\n\n#### Creating your own drivers\nIt's possible to create a driver of the HTML2PDF generation library of your choice. Simply create your driver and register it with the `PdfTinkerManager`.\n\n1. First things first, this is the time to create your driver. Your driver should extend `\\Traincase\\HtmlToPdfTinker\\Drivers\\Driver`. You can take an example from `Traincase\\LaravelPdfTinker\\DompdfDriver`.\n2. Register it with the `PdfTinkerManager`. Add the following lines to one of your registered service providers in the `boot` method.\n    ```php\n    public function boot()\n    {\n        if ($this-\u003eapp-\u003eisLocal()) {\n            $this-\u003eapp-\u003eresolving(\\Traincase\\HtmlToPdfTinker\\PdfTinkerManager::class, function($manager) {\n                $manager-\u003eextend('test-driver', function() {\n                    // Need to fetch some things from the container? Sure.\n                    $dependency = $this-\u003eapp-\u003emake(\\SomeFancyClass::class);\n      \n                    return new \\App\\Drivers\\YourFancyDriver($dependency);\n                });\n            });\n        }\n    }\n    ```\n3. Your driver will automatically show up in the interface in the drivers dropdown, you're free to tinker!\n\n### Ready, set...\nIf you followed all the installation instructions go ahead and tinker away! Open up your browser and navigate to `your-app.tld/vendor/laravel-pdf-tinker/playground`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftraincase%2Flaravel-pdf-tinker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftraincase%2Flaravel-pdf-tinker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftraincase%2Flaravel-pdf-tinker/lists"}