PHP code example of arielmejiadev / filament-printable
1. Go to this page and download the library: Download arielmejiadev/filament-printable library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
arielmejiadev / filament-printable example snippets
// Add print button in a filament list header
class ListUsers extends ListRecords
{
protected function getHeaderActions(): array
{
return [
// ...
PrintAction::make(),
];
}
}
// Add print button in Filament CreateRecord or EditRecord class
class EditUser extends EditRecord
{
protected function getHeaderActions(): array
{
return [
// ...
\ArielMejiaDev\FilamentPrintable\Actions\PrintAction::make(),
];
}
}
// Add print button as a bulk action
->bulkActions([
Tables\Actions\BulkActionGroup::make([
Tables\Actions\DeleteBulkAction::make(),
\ArielMejiaDev\FilamentPrintable\Actions\PrintBulkAction::make(),
]),
]);