PHP code example of traincase / laravel-pdf-tinker

1. Go to this page and download the library: Download traincase/laravel-pdf-tinker library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

traincase / laravel-pdf-tinker example snippets


// Put this inside the 'register' method
if ($this->app->isLocal()) {
    $this->register(\Traincase\LaravelPdfTinker\PdfTinkerServiceProvider::class);
}

    public function boot()
    {
        if ($this->app->isLocal()) {
            $this->app->resolving(\Traincase\HtmlToPdfTinker\PdfTinkerManager::class, function($manager) {
                $manager->extend('test-driver', function() {
                    // Need to fetch some things from the container? Sure.
                    $dependency = $this->app->make(\SomeFancyClass::class);
      
                    return new \App\Drivers\YourFancyDriver($dependency);
                });
            });
        }
    }