Link to the repository
[Only for premium members]
[Only for premium members]
Now that we have our Quotes being created, we should have the ability to generate a PDF and send it to our customer:
In this lesson, we will do the following:
We can quickly create a new View page by running the following command:
php artisan make:filament-page ViewQuote --resource=QuoteResource --type=ViewRecord
This will generate a file, but we still need to register it in our Resource:
app/Filament/Resources/QuoteResource.php
// ... public static function table(Table $table): Table { return $table // ... ->bulkActions([ Tables\Actions\BulkActionGroup::make([ Tables\Actions\DeleteBulkAction::make(), ]), ]); ]) ->recordUrl(function ($record) { return Pages\ViewQuote::getUrl([$record]); }); } public static function getPages(): array{ return [ 'index' => Pages\ListQuotes::route('/'), 'create' => Pages\CreateQuote::route('/create'), 'view' => Pages\ViewQuote::route('/{record}'), 'edit' => Pages\EditQuote::route('/{record}/edit'), ];}
Now we can click on the row, and we should see our new page:
That's it for now. Next, we will generate the PDF and display it on the View page.
Next, we will install a package Laravel Invoices to deal with the invoice generation itself:
Note: This can be replaced with any other package or just pure DomPDF
composer require laraveldaily/laravel-invoices:^3.1
Then, we need to publish the package files:
php artisan invoices:install
This will create...