Quoin
Guide
Laravel
Math
Reference
Examples
Gallery
Changelog
GitHub
Guide
Laravel
Math
Reference
Examples
Gallery
Changelog
GitHub
  • Laravel

    • Laravel
    • Configuration
    • Preview routes
    • Recipes
    • From Tailwind

Preview routes

Preview routes give each document a fixed URL that renders it with sample data. Refresh the browser to see your latest change.

Register each view with a closure that returns its data, for example in a service provider:

use Quoin\Laravel\Facades\Quoin;

Quoin::preview('pdf.invoice', fn () => ['invoice' => Invoice::factory()->make()]);

Then set QUOIN_PREVIEW=true in your .env file.

RouteWhat it shows
GET /_quoina list of the registered views
GET /_quoin/{view}one view, as a PDF in the browser
GET /_quoin/{view}?format=htmlthe same view as HTML
GET /_quoin/{view}?format=docxthe same view as a Word file. Needs quoin/docx; without it you get a 404 with the install command

Any other format value is a 404.

The routes work only in the local environment, whatever the setting says. To change the URL prefix, set preview.path.

Edit this page on GitHub
Last Updated: 11/17/26, 2:47 PM
Prev
Configuration
Next
Recipes