© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•2y ago•
15 replies
Soundmit

Add Printjs to infolist action

Hi, in my app i have an infolist with a button 'print'
 
#PRINT INVOICE
                            Action::make(__('repair.print'))
                            ->action(fn ($data, Repair $record) => redirect()->to(
                                route('repair.pdf.'.$data['type'], $record)
                            ))
                         
                            ->icon('heroicon-s-printer')
                            ->form([
                                Forms\Components\Radio::make('type')
                                    ->label('')
                                    ->default('receipt')
                                    ->options(PrintOptions::class)
                                    ->disableOptionWhen(function (string $value, Model $record) {
                                        return $value === 'aggregate' && $record->parts === null || $value === 'regular' && $record->parts === null;
                                    })
                            ])
 
#PRINT INVOICE
                            Action::make(__('repair.print'))
                            ->action(fn ($data, Repair $record) => redirect()->to(
                                route('repair.pdf.'.$data['type'], $record)
                            ))
                         
                            ->icon('heroicon-s-printer')
                            ->form([
                                Forms\Components\Radio::make('type')
                                    ->label('')
                                    ->default('receipt')
                                    ->options(PrintOptions::class)
                                    ->disableOptionWhen(function (string $value, Model $record) {
                                        return $value === 'aggregate' && $record->parts === null || $value === 'regular' && $record->parts === null;
                                    })
                            ])

this action all a route that generate and show a pdf in the browser (same tab)
now i want to add printerjs in order to print it directly

i've added print js with npm
import in app.js
compiled with npm run build
and inspecting the code, the library seems to be loaded right

now
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Database Notification Actions: Infolist in action?
FilamentFFilament / ❓┊help
3y ago
How to test Infolist Action?
FilamentFFilament / ❓┊help
2y ago
passing data to infolist action
FilamentFFilament / ❓┊help
3y ago
Infolist - send data to Action
FilamentFFilament / ❓┊help
3y ago