Download the PHP package filamentphp/advanced-export without Composer

On this page you can find all versions of the php package filamentphp/advanced-export. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package advanced-export

Filament Advanced Export

Latest Version on Packagist Total Downloads License

Advanced export functionality for Filament resources with dynamic column selection, filtering, ordering, and background processing.

Features

Requirements

Installation

Install the package via Composer:

Run the installation command:

This will:

Manual Configuration

If you prefer manual setup, publish assets individually:

Quick Start

Option 1: One-Command Setup (Recommended)

The fastest way to add export functionality to any Filament resource:

This single command will:

  1. Configure the Model - Add Exportable interface, trait, and export methods
  2. Generate Views - Create both simple and advanced export Blade templates
  3. Update ListRecords - Add the HasAdvancedExport trait and export action

That's it! Your resource now has full export functionality.

Options

Option 2: Step-by-Step Setup

If you prefer more control, you can set up each component individually:

1. Configure the Model

Or manually add the interface and methods:

2. Generate Export Views

This creates:

3. Add Trait to ListRecords

Automatic Filter Support

One of the key features of this package is automatic filter support. When users apply filters to your Filament table (e.g., ?filters[status][values][0]=pending), the export will automatically respect those filters.

How It Works

The package automatically:

  1. Extracts all active filters from the Filament table
  2. Checks if the filter column exists in the database table
  3. Applies the appropriate WHERE or WHERE IN clause

Supported Filter Types

Filter Type Example URL Query Applied
Single value ?filters[status][value]=active WHERE status = 'active'
Multiple values ?filters[status][values][0]=pending&filters[status][values][1]=active WHERE status IN ('pending', 'active')
Date range ?filters[created_at][from]=2024-01-01&filters[created_at][until]=2024-12-31 WHERE created_at BETWEEN ...

Custom Filter Handling

For complex filters that don't map directly to columns, override the applyCustomFilter method:

Configuration

The configuration file is published to config/advanced-export.php:

CSV Export

The export modal includes a format selector. Users can choose between XLSX and CSV:

CSV exports use the CsvExport class which implements FromCollection and WithHeadings for clean tabular output without view templates.

Record Count Preview

The export modal shows how many records will be exported before the user clicks the export button. This count respects active filters and the configured maximum limit.

Fallback Filter Configuration

When dynamic filter extraction fails (e.g., non-standard table implementations), the package falls back to a configurable list of filter names:

You can also override per-resource:

Security

Error Handling

Export errors show a generic message to the user and log the full error internally:

Input Validation

Screenshots

Export Modal

Advanced Usage

Relationship Columns

You can export relationship data simply by using the relationship name as the column key:

The package will automatically detect and load the relationship, displaying the related model's default display value.

For more specific relationship data (like a specific attribute), use dot notation:

Eager Loading Relationships

To optimize performance, specify relationships to eager load:

Custom Ordering

The package validates order columns and directions automatically. Dot notation columns (relationship paths) are skipped by default.

To handle ordering by relationship columns, override applyCustomOrdering():

Using Package Default Views

If you don't want to create custom views for each model:

Artisan Commands

export:resource (Recommended)

Complete setup for a Filament resource in one command:

This command:

export:install

Initial package setup:

export:model

Add export methods to a model:

export:views

Generate export views for a model:

export:publish

Publish package assets:

Translations

The package includes translations for:

To add more languages, publish the translations and create new language files:

Then create resources/lang/vendor/advanced-export/{locale}/messages.php.

Background Processing with Notifications

The package includes a powerful background export feature with automatic database notifications. This is ideal for large exports that would otherwise timeout.

Using Background Export Action

Add the background export action to your ListRecords page:

How It Works

  1. User clicks "Background Export" button
  2. A confirmation modal appears
  3. Upon confirmation, ProcessExportJob is dispatched to the queue
  4. User sees a notification that the export is being processed
  5. When complete, a database notification appears with a download link
  6. If the export fails, a failure notification is sent

Requirements for Database Notifications

Make sure your Filament panel has database notifications enabled:

Running the Queue Workers

Background exports require queue workers. Run both the exports queue and the default queue (for notifications):

Or use a single worker for both:

Dispatching Exports Programmatically

You can also dispatch exports directly:

Configuring the User Model

If you use a custom user model, configure it in config/advanced-export.php:

Filter Support in Background Exports

Background exports fully support all filter types:

Filter Type Automatically Handled
Direct columns status, type
Relationship filters insurerinsurer_id
Date ranges created_at[from/until]
Multiple values status[values][0,1,2]

The ProcessExportJob automatically resolves relationship filter names to their actual column names (e.g., insurerinsurer_id).

Customizing Blade Views

The package uses Blade views to render Excel exports. You can customize these views to format data, add styling, or handle special fields.

View Types

Type Generated File Purpose
Simple {table}-excel.blade.php Exports all model attributes automatically
Advanced {table}-excel-advanced.blade.php Exports only user-selected columns with custom titles

View Variables

Both views receive these variables:

Variable Type Description
${tableName} Collection The records to export (e.g., $declarations)
$columnsConfig array User-selected columns with titles (advanced only)

Basic View Structure

Custom Field Formatting

Use @switch statements to format specific fields:

Complete Custom View Example

Here's a full example for a declarations export:

Using Package Default Views

If you don't need custom formatting, enable the package's default views:

The default views automatically:

Styling Excel Output

Maatwebsite Excel supports basic HTML styling:

Customizing the Export Button

Override trait methods to customize appearance:

FilamentShield Integration

If you use FilamentShield, the export button can be controlled per role/resource.

Step 1: Add the trait to your Resource

This registers export as a permission prefix. When you run php artisan shield:generate, Shield will create Export:Titular automatically.

Step 2: That's it!

The export button will only be visible to users with the Export:{Resource} permission. Without Shield installed, the button is visible to everyone.

How it works

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Contributions are welcome! Please see CONTRIBUTING for details.

Security

If you discover any security-related issues, please email [email protected] instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.


All versions of advanced-export with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
filament/filament Version ^4.0|^5.0
illuminate/contracts Version ^11.0|^12.0
illuminate/support Version ^11.0|^12.0
maatwebsite/excel Version ^3.1|^4.0
spatie/laravel-package-tools Version ^1.16
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package filamentphp/advanced-export contains the following files

Loading the files please wait ...