PHPackages                             alperenersoy/filament-export - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. alperenersoy/filament-export

ActiveLibrary

alperenersoy/filament-export
============================

Customizable export and print functionality for Filament Admin Panel

v4.0.1(8mo ago)272328.0k↓16.9%54[20 issues](https://github.com/alperenersoy/filament-export/issues)[3 PRs](https://github.com/alperenersoy/filament-export/pulls)2MITPHPPHP ^8.2CI passing

Since Jul 14Pushed 8mo ago9 watchersCompare

[ Source](https://github.com/alperenersoy/filament-export)[ Packagist](https://packagist.org/packages/alperenersoy/filament-export)[ RSS](/packages/alperenersoy-filament-export/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (7)Versions (51)Used By (2)

Filament Export
===============

[](#filament-export)

Customizable export and print functionality for Filament Admin Panel.

This package provides a bulk action and header action to export your filament tables easily.

[![filament-export-3](https://user-images.githubusercontent.com/83382417/179013026-14ddd872-fedc-45d2-954a-1447005777bb.png)](https://user-images.githubusercontent.com/83382417/179013026-14ddd872-fedc-45d2-954a-1447005777bb.png)

Requirements
------------

[](#requirements)

- PHP 8
- [Filament 2.0](https://github.com/laravel-filament/filament)

### Dependencies

[](#dependencies)

- [spatie/simple-excel](https://github.com/spatie/simple-excel)
- [barryvdh/laravel-dompdf](https://github.com/barryvdh/laravel-dompdf)

Installation
------------

[](#installation)

```
composer require alperenersoy/filament-export
```

### Configuring for Standalone Table Builder (Experimental)

[](#configuring-for-standalone-table-builder-experimental)

To use this package in a standalone table builder instead of Filament Admin Panel you need to follow these steps. Otherwise, some features such as print and preview may not work properly.

1. Import `filament-export.css` in your `/resources/app.css`

```
@import '../../vendor/alperenersoy/filament-export/resources/css/filament-export.css';
```

2. Import `filament-export.js` in your `/resources/app.js`

```
import '../../vendor/alperenersoy/filament-export/resources/js/filament-export.js';
```

3. Compile your assets

```
npm run dev
```

Using
-----

[](#using)

### Simple Usage

[](#simple-usage)

#### Bulk Action

[](#bulk-action)

You can export selected rows with the bulk action.

**Filament Admin Panel**

```
$table->bulkActions([
    ...
    FilamentExportBulkAction::make('export')
    ...
]);
```

**Filament Table Builder**

```
protected function getTableBulkActions(): array
{
    return [
        ...
        FilamentExportBulkAction::make('Export'),
        ...
    ];
}
```

#### Header Action

[](#header-action)

You can filter, search, sort and export your table with the header action.

**Filament Admin Panel**

```
$table->headerActions([
    ...
    FilamentExportHeaderAction::make('export')
    ...
]);
```

**Filament Table Builder**

```
protected function getTableHeaderActions(): array
{
    return [
        ...
        FilamentExportHeaderAction::make('Export'),
        ...
    ];
}
```

Since ButtonAction is deprecated you may use this action with -&gt;button() instead.

### Full Usage

[](#full-usage)

Both actions provide functions for configuration.

```
FilamentExportBulkAction::make('export')
    ->fileName('My File') // Default file name
    ->timeFormat('m y d') // Default time format for naming exports
    ->disablePdf() // Disable PDF format for download
    ->disableXlsx() // Disable XLSX format for download
    ->disableCsv() // Disable CSV format for download
    ->defaultFormat('pdf') // xlsx, csv or pdf
    ->defaultPageOrientation('landscape') // Page orientation for pdf files. portrait or landscape
    ->directDownload() // Download directly without showing modal
    ->disableAdditionalColumns() // Disable additional columns input
    ->disableFilterColumns() // Disable filter columns input
    ->disableFileName() // Disable file name input
    ->disableFileNamePrefix() // Disable file name prefix
    ->disablePreview() // Disable export preview
    ->disableTableColumns() // Disable table columns in the export
    ->withHiddenColumns() //Show the columns which are toggled hidden
    ->fileNameFieldLabel('File Name') // Label for file name input
    ->formatFieldLabel('Format') // Label for format input
    ->pageOrientationFieldLabel('Page Orientation') // Label for page orientation input
    ->filterColumnsFieldLabel('filter columns') // Label for filter columns input
    ->additionalColumnsFieldLabel('Additional Columns') // Label for additional columns input
    ->additionalColumnsTitleFieldLabel('Title') // Label for additional columns' title input
    ->additionalColumnsDefaultValueFieldLabel('Default Value') // Label for additional columns' default value input
    ->additionalColumnsAddButtonLabel('Add Column') // Label for additional columns' add button
    ->withColumns([TextColumn::make('additionalModelColumn')]) // Export additional model columns that aren't visible in the table results
    ->csvDelimiter(',') // Delimiter for csv files
    ->modifyExcelWriter(fn (SimpleExcelWriter $writer) => $writer->nameCurrentSheet('Sheet')) // Modify SimpleExcelWriter before download
    ->modifyPdfWriter(fn (\Barryvdh\DomPDF\PDF|\Barryvdh\Snappy\PdfWrapper $writer) => $writer->setPaper('a4', 'landscape')) // Modify DomPdf or Snappy writer before download
    ->formatStates([
        'name' => fn (?Model $record) => strtoupper($record->name),
    ]) // Manually format states for a specific column
```

You can also use default bulk action and header action functions to customize actions.

Performance Tips for Large Datasets
-----------------------------------

[](#performance-tips-for-large-datasets)

- Since header action does server-side pagination you may choose header action over bulk action.
- You may disable preview.
- You may enable direct download.

Configuration
-------------

[](#configuration)

Publish configuration

```
php artisan vendor:publish --provider="AlperenErsoy\FilamentExport\FilamentExportServiceProvider" --tag="config"
```

You can configure these settings:

```
return [
    'default_format' => 'xlsx',
    'time_format' => 'M_d_Y-H_i',
    'default_page_orientation' => 'portrait',
    'disable_additional_columns' => false,
    'disable_filter_columns' => false,
    'disable_file_name' => false,
    'disable_preview' => false,
    'use_snappy' => false,
    'action_icon' => 'heroicon-o-document-download',
    'preview_icon' => 'heroicon-o-eye',
    'export_icon' => 'heroicon-o-download',
    'print_icon' => 'heroicon-o-printer',
    'cancel_icon' => 'heroicon-o-x-circle'
];
```

Overriding Views
----------------

[](#overriding-views)

Publish views

```
php artisan vendor:publish --provider="AlperenErsoy\FilamentExport\FilamentExportServiceProvider" --tag="views"
```

This package has two views:

1. "components\\table\_view.blade.php" view is used for preview.
2. "pdf.blade.php" view is used as pdf export template.
3. "print.blade.php" view is used as print template.

### Using Custom Variables In Templates

[](#using-custom-variables-in-templates)

```
FilamentExportBulkAction::make('export')
    ->extraViewData([
        'myVariable' => 'My Variable'
    ])
```

or use closures

```
FilamentExportHeaderAction::make('export')
    ->extraViewData(fn ($action) => [
        'recordCount' => $action->getRecords()->count()
    ])
```

Then use them in the templates as regular blade variables:

```
{{ $myVariable }}
```

Using Snappy
------------

[](#using-snappy)

By default, this package uses [dompdf](https://github.com/barryvdh/laravel-dompdf) as pdf generator.

If you want to use Snappy instead you need to install **barryvdh/laravel-snappy** to your project and configure it yourself. (See [barryvdh/laravel-snappy](https://github.com/barryvdh/laravel-snappy) for more information.)

To use snappy for PDF exports:

1. You can simply add -&gt;snappy() to your actions.

```
FilamentExportBulkAction::make('export')
    ->snappy()
```

or

```
FilamentExportHeaderAction::make('export')
    ->snappy()
```

2. You can update the config file to use it as default.

```
[
    ...
    'use_snappy' => true,
    ...
]
```

###  Health Score

58

—

FairBetter than 98% of packages

Maintenance59

Moderate activity, may be stable

Popularity55

Moderate usage in the ecosystem

Community31

Small or concentrated contributor base

Maturity73

Established project with proven stability

 Bus Factor1

Top contributor holds 79.1% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~23 days

Recently: every ~17 days

Total

50

Last Release

256d ago

Major Versions

v0.3.10 → v3.0.52024-09-21

v0.3.11 → v3.0.62024-10-11

v0.3.12 → v3.0.72024-10-11

v0.3.13 → v3.0.102025-03-25

v0.3.14 → v4.0.12025-09-04

PHP version history (2 changes)v0.1.0-alphaPHP ^8.0

v4.0.1PHP ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/d1350cba068ea4e7ba8b1a0e6ea918ec1cdac6537a1f89f0cd2798d98fdc3189?d=identicon)[alperenersoy](/maintainers/alperenersoy)

---

Top Contributors

[![alperenersoy](https://avatars.githubusercontent.com/u/83382417?v=4)](https://github.com/alperenersoy "alperenersoy (117 commits)")[![AlanD20](https://avatars.githubusercontent.com/u/30084112?v=4)](https://github.com/AlanD20 "AlanD20 (4 commits)")[![shopapps](https://avatars.githubusercontent.com/u/8806928?v=4)](https://github.com/shopapps "shopapps (3 commits)")[![nicolasbaud](https://avatars.githubusercontent.com/u/63586531?v=4)](https://github.com/nicolasbaud "nicolasbaud (3 commits)")[![perryfaro](https://avatars.githubusercontent.com/u/1935984?v=4)](https://github.com/perryfaro "perryfaro (3 commits)")[![llowinge](https://avatars.githubusercontent.com/u/12760541?v=4)](https://github.com/llowinge "llowinge (2 commits)")[![petertoye](https://avatars.githubusercontent.com/u/24882478?v=4)](https://github.com/petertoye "petertoye (2 commits)")[![cswni](https://avatars.githubusercontent.com/u/14812743?v=4)](https://github.com/cswni "cswni (2 commits)")[![inerba](https://avatars.githubusercontent.com/u/5882517?v=4)](https://github.com/inerba "inerba (2 commits)")[![vdeville](https://avatars.githubusercontent.com/u/6104498?v=4)](https://github.com/vdeville "vdeville (1 commits)")[![ziming](https://avatars.githubusercontent.com/u/679513?v=4)](https://github.com/ziming "ziming (1 commits)")[![angelgnz](https://avatars.githubusercontent.com/u/69648541?v=4)](https://github.com/angelgnz "angelgnz (1 commits)")[![devOMAR-2](https://avatars.githubusercontent.com/u/93110311?v=4)](https://github.com/devOMAR-2 "devOMAR-2 (1 commits)")[![josefbehr](https://avatars.githubusercontent.com/u/4368880?v=4)](https://github.com/josefbehr "josefbehr (1 commits)")[![mliell](https://avatars.githubusercontent.com/u/4391791?v=4)](https://github.com/mliell "mliell (1 commits)")[![mtsunu](https://avatars.githubusercontent.com/u/4941448?v=4)](https://github.com/mtsunu "mtsunu (1 commits)")[![ncavare](https://avatars.githubusercontent.com/u/9728577?v=4)](https://github.com/ncavare "ncavare (1 commits)")[![ruswan](https://avatars.githubusercontent.com/u/6128359?v=4)](https://github.com/ruswan "ruswan (1 commits)")[![techdaddies-kevin](https://avatars.githubusercontent.com/u/1930280?v=4)](https://github.com/techdaddies-kevin "techdaddies-kevin (1 commits)")

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/alperenersoy-filament-export/health.svg)

```
[![Health](https://phpackages.com/badges/alperenersoy-filament-export/health.svg)](https://phpackages.com/packages/alperenersoy-filament-export)
```

###  Alternatives

[bagisto/bagisto

Bagisto Laravel E-Commerce

26.2k161.6k7](/packages/bagisto-bagisto)[krayin/laravel-crm

Krayin CRM

22.0k32.8k1](/packages/krayin-laravel-crm)[laraveldaily/laravel-invoices

Missing invoices for Laravel

1.5k1.3M4](/packages/laraveldaily-laravel-invoices)[unopim/unopim

UnoPim Laravel PIM

9.4k1.8k](/packages/unopim-unopim)[filament/filament

A collection of full-stack components for accelerated Laravel app development.

3722.7M2.4k](/packages/filament-filament)[lukasss93/laravel-larex

Translate your Laravel application from a single CSV file!

9790.3k2](/packages/lukasss93-laravel-larex)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
