Back to School: coupon SCHOOL25 for 40% off Yearly/Lifetime membership! Read more here

Generate Invoice PDF and Send via Email

Filament 4
Also available in Filament 3 version

A demonstration of generating PDFs after record creation, downloading them from a Filament panel, and sending invoices via email.

01JAYSQ1S8PHV0VDY4JJ592F91

Get the Source Code:

How it works

In a Filament resource, we have a simple form to enter details for the invoice.

app/Filament/Resources/Invoices/Schemas/InvoiceForm.php:

use Filament\Schemas\Schema;
use Filament\Forms\Components\TextInput;
 
public static function configure(Schema $schema): Schema
{
return $schema
->components([
TextInput::make('customer_name')
->required(),
TextInput::make('customer_email')
->required(),
TextInput::make('product')
->required(),
TextInput::make('price')
->numeric()
->required(),
]);
}

Two models lifecycle events are used when a record is being creating and created. Within the creating event, a serial is generated, and after the record is created, a job to generate a PDF is dispatched.

The FULL tutorial is available after the purchase: in the Readme file of the official repository you would get invited to.
Get the Source Code: All 151 Premium Examples for $99