Download the PHP package traincase/laravel-pdf-tinker without Composer

On this page you can find all versions of the php package traincase/laravel-pdf-tinker. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-pdf-tinker

Laravel PDF Tinker

This package is meant as a tool for local development. Do not include this package in your production build.

Latest Version on Packagist Quality Score

Laravel PDF Tinker gives you a quick interface to debug and fiddle with the creation of HTML templates that will be converted into PDF's.

If 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.

alt text

Installation

Since this package is only meant for during local development install this package as a development dependency.

composer require traincase/laravel-pdf-tinker --dev

The package will automatically register it's service provider, if you opted out of auto-discovery add something along the lines of the following to a registered service provider (for example the AppServiceProvider):

Don't forget to check the drivers section to see if the driver you're planning to use requires any additional set-up.

Usage

You can find most options straight in the interface of the playground. Chances are high you don't have to edit the configuration. Nevertheless, there are a few things you can configure.

Configuration

Route prefix

The service provider will register a few routes necessary to set up and run the playground. By default the routes are all prefixed with vendor/laravel-pdf-tinker. This means the playground is available at your-app.tld/vendor/laravel-pdf-tinker/playground.

Do you have an unlikely collision with your routes? No worries!

You 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.

Driver options

If you published the configuration file you can also update the default_driver_options.<your-driver-alias> key to set the default options that will be set in the interface (under Configuration > Options). This will just be used when you enter the playground, you can always update the configuration inside the playground. Any changes will not be persisted once you leave the page, so if you tinker a lot you might want to override the default options.

Drivers

Currently there are two drivers available.

DomPDF

DomPdf is the easiest driver to get started. Everything should already be in place after following the installation instructions.

Happy tinkering!

Wkhtmltopdf

The wkhtmltopdf driver needs the wkhtmltopdf executable to be available in your PATH. This means that if you run wkhtmltopdf --version in a terminal it should output something like the following:

If you're using mac&homebrew you can run brew cask install wkhtmltopdf. On any other system download the binaries for your system from the wkhtmltopdf website.

Creating your own drivers

It's possible to create a driver of the HTML2PDF generation library of your choice. Simply create your driver and register it with the PdfTinkerManager.

  1. 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.
  2. Register it with the PdfTinkerManager. Add the following lines to one of your registered service providers in the boot method.

  3. Your driver will automatically show up in the interface in the drivers dropdown, you're free to tinker!

Ready, set...

If 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.


All versions of laravel-pdf-tinker with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
ext-json Version *
traincase/html-to-pdf-tinker Version ^2.0
laravel/framework Version ^11.0
league/flysystem Version ^3.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package traincase/laravel-pdf-tinker contains the following files

Loading the files please wait ....