Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
kinetix-pdf-templates
kinetix-pdf-templates
happones/kinetix
claude-code
pdf-templates
document-generation
dompdf
migrations
uuid-ulid
livewire-components
field-configuration

Configurable PDF document formats (quotes, invoices, receipts): Mailable-style PdfTemplate classes with declarative fields, a live-preview configurator component, per-team persisted settings and dompdf/barryvdh/spatie drivers. Activates when building customizable PDFs or document generation.

Install
php artisan boost:add-skill happones/kinetix

Save this content to: .claude/skills/kinetix-pdf-templates/SKILL.md

# Kinetix PDF Templates Development

## When to Apply

Activate this skill when:
- Declaring a document format (`PdfTemplate` subclass, `PdfField` knobs) or registering it (`KinetixPdf::register`).
- Mounting `<KinetixPdfTemplate template="…" />` (configurator + live preview + download).
- Generating real documents (`KinetixPdf::render/pdf`) or choosing a driver (`kinetix.pdf.driver`).

## Documentation

For full details, reference `docs/pdf-templates.md` (published at https://happones.github.io/kinetix/pdf-templates).

## Essentials

```php
class QuotePdf extends PdfTemplate
{
    public static string $key = 'quote';
    public function sampleData(): array { /* preview data */ }
}

KinetixPdf::register(QuotePdf::class);          // provider boot()
$pdf = KinetixPdf::pdf('quote', $quote);        // binary, stored settings applied
```

- Models implement `Pdf\Contracts\ProvidesPdfData` (`toPdfData(): array` mapping the record onto the data shape) and are passed directly to `render()/pdf()`; the interface is optional (hybrid detection — any object with the method works), plain arrays are always accepted, other objects throw.

- Default `fields()` = standard knobs (accent/text color, font, title, logo, status, SKU, striped, footer, signature); override with `PdfField::color/text/select/toggle/number`.
- Default layout = built-in generic document (`DocumentBuilder`, dompdf-safe inline CSS). Custom: override `html()` (PHP) or `view()` (Blade, receives settings/data/template).
- Settings persist in `kinetix_pdf_templates` (publish `--tag=kinetix-pdf-migrations`), per team when team scoping applies. Endpoints gated by `viewKinetixPdf` (local-only default).
- Drivers auto-detected: spatie/laravel-pdf → barryvdh/laravel-dompdf → dompdf/dompdf. Only DECLARED fields are read from requests (undeclared keys never reach the store/renderer).

## UUID / ULID Host Models

This feature's migration builds `team_id` with
`Happones\Kinetix\Support\HostKeys`, which types each column after YOUR model
at migrate time from its primary key (`HasUlids` -> ulid, `HasUuids` -> uuid, string `$keyType` ->
string, else bigint). Pin `kinetix.key_types.user|team` when detection cannot
see the setup; morph ids follow `kinetix.key_types.morph` (default bigint) —
set it when the referenced models use UUIDs/ULIDs. Apps migrated on an older
Kinetix have bigint columns on disk and need their own ALTER migration. Full
recipe: the `kinetix-boost` skill, section "UUID / ULID Host Models".

Kinetix PDF Templates Development

When to Apply

Activate this skill when:

  • Declaring a document format (PdfTemplate subclass, PdfField knobs) or registering it (KinetixPdf::register).
  • Mounting <KinetixPdfTemplate template="…" /> (configurator + live preview + download).
  • Generating real documents (KinetixPdf::render/pdf) or choosing a driver (kinetix.pdf.driver).

Documentation

For full details, reference docs/pdf-templates.md (published at https://happones.github.io/kinetix/pdf-templates).

Essentials

class QuotePdf extends PdfTemplate
{
    public static string $key = 'quote';
    public function sampleData(): array { /* preview data */ }
}

KinetixPdf::register(QuotePdf::class);          // provider boot()
$pdf = KinetixPdf::pdf('quote', $quote);        // binary, stored settings applied
  • Models implement Pdf\Contracts\ProvidesPdfData (toPdfData(): array mapping the record onto the data shape) and are passed directly to render()/pdf(); the interface is optional (hybrid detection — any object with the method works), plain arrays are always accepted, other objects throw.

  • Default fields() = standard knobs (accent/text color, font, title, logo, status, SKU, striped, footer, signature); override with PdfField::color/text/select/toggle/number.

  • Default layout = built-in generic document (DocumentBuilder, dompdf-safe inline CSS). Custom: override html() (PHP) or view() (Blade, receives settings/data/template).

  • Settings persist in kinetix_pdf_templates (publish --tag=kinetix-pdf-migrations), per team when team scoping applies. Endpoints gated by viewKinetixPdf (local-only default).

  • Drivers auto-detected: spatie/laravel-pdf → barryvdh/laravel-dompdf → dompdf/dompdf. Only DECLARED fields are read from requests (undeclared keys never reach the store/renderer).

UUID / ULID Host Models

This feature's migration builds team_id with Happones\Kinetix\Support\HostKeys, which types each column after YOUR model at migrate time from its primary key (HasUlids -> ulid, HasUuids -> uuid, string $keyType -> string, else bigint). Pin kinetix.key_types.user|team when detection cannot see the setup; morph ids follow kinetix.key_types.morph (default bigint) — set it when the referenced models use UUIDs/ULIDs. Apps migrated on an older Kinetix have bigint columns on disk and need their own ALTER migration. Full recipe: the kinetix-boost skill, section "UUID / ULID Host Models".

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
robertmarney/lara-hierarchial-collections
simonschaufi/rule-doc-generator
emissaoja/emissaoja
blackbricksoftware/gravityforms-civicrm-form-processor
al-rahabi/fancy-crud
jinas/dhivatar-component
mltstephane/laravel-quality
bernskiold/laravel-talentlms
bernskioldmedia/laravel-form-architect