PHPackages                             think.studio/nova-resource-dynamic-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. [Utility &amp; Helpers](/categories/utility)
4. /
5. think.studio/nova-resource-dynamic-export

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

think.studio/nova-resource-dynamic-export
=========================================

Functionality to dynamically export resources.

1.0.0(2y ago)0581MITPHPPHP ^8.1

Since Sep 6Pushed 2y agoCompare

[ Source](https://github.com/dev-think-one/nova-resource-dynamic-export)[ Packagist](https://packagist.org/packages/think.studio/nova-resource-dynamic-export)[ Docs](https://github.com/dev-think-one/nova-resource-dynamic-export)[ RSS](/packages/thinkstudio-nova-resource-dynamic-export/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (9)Versions (2)Used By (1)

Laravel nova resources dynamic export export
============================================

[](#laravel-nova-resources-dynamic-export-export)

[![Packagist License](https://camo.githubusercontent.com/6f9a546100a78f18b5b91354d98ba3390c782da6ced160952395a5d17941a1ef/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f7468696e6b2e73747564696f2f6e6f76612d7265736f757263652d64796e616d69632d6578706f72743f636f6c6f723d253233346463373166)](https://camo.githubusercontent.com/6f9a546100a78f18b5b91354d98ba3390c782da6ced160952395a5d17941a1ef/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f7468696e6b2e73747564696f2f6e6f76612d7265736f757263652d64796e616d69632d6578706f72743f636f6c6f723d253233346463373166)[![Packagist Version](https://camo.githubusercontent.com/fb0bcfab0b87c9c141336b50a7a62914f77da94771d98af7f6d20383445c4585/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7468696e6b2e73747564696f2f6e6f76612d7265736f757263652d64796e616d69632d6578706f7274)](https://packagist.org/packages/think.studio/nova-resource-dynamic-export)[![Total Downloads](https://camo.githubusercontent.com/22d6354de89e23e991deb31b262096dfbf6669bb7f563a9e1707ba2e0cf058d0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7468696e6b2e73747564696f2f6e6f76612d7265736f757263652d64796e616d69632d6578706f7274)](https://packagist.org/packages/think.studio/nova-resource-dynamic-export)[![Build Status](https://camo.githubusercontent.com/ccb393a755fc4c98316cf79f0001f6f1d3e09bd52cef522fd57fe970beffe966/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6465762d7468696e6b2d6f6e652f6e6f76612d7265736f757263652d64796e616d69632d6578706f72742f6261646765732f6275696c642e706e673f623d6d61696e)](https://scrutinizer-ci.com/g/dev-think-one/nova-resource-dynamic-export/build-status/main)[![Code Coverage](https://camo.githubusercontent.com/a894bd9925126a330c9ff0a1af357a95cf27e91c4eea926ac288f5a2b24ccaf5/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6465762d7468696e6b2d6f6e652f6e6f76612d7265736f757263652d64796e616d69632d6578706f72742f6261646765732f636f7665726167652e706e673f623d6d61696e)](https://scrutinizer-ci.com/g/dev-think-one/nova-resource-dynamic-export/?branch=main)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/ae29d7c73523902a7396100efec51b4a9b2baac88ea09d2ae8969ad0aa43c8bf/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6465762d7468696e6b2d6f6e652f6e6f76612d7265736f757263652d64796e616d69632d6578706f72742f6261646765732f7175616c6974792d73636f72652e706e673f623d6d61696e)](https://scrutinizer-ci.com/g/dev-think-one/nova-resource-dynamic-export/?branch=main)

Functionality to dynamically export resources.

NovaPackageV4V1Installation
------------

[](#installation)

You can install the package via composer:

```
composer require think.studio/nova-resource-dynamic-export

# optional publish configs
php artisan vendor:publish --provider="NovaResourceDynamicExport\ServiceProvider" --tag="config"
```

Update filesystem configuration if you will used default storage disk.

```
// config/filesystems.php
'exports'                            => [
    'driver' => 'local',
    'root'   => storage_path('app/exports'),
],
```

And add resource to your admin:

```
// Providers/NovaServiceProvider.php
protected function resources(): void
{
    parent::resources();
    Nova::resources([
        \NovaResourceDynamicExport\Nova\Resources\ExportStoredFile::class,
    ]);
}
```

`Please do not forget add policies for \NovaResourceDynamicExport\Models\ExportStoredFile model or your custom model`

Usage
-----

[](#usage)

### General resources export action

[](#general-resources-export-action)

```
public function actions(NovaRequest $request): array
{
    return [
        \NovaResourceDynamicExport\Nova\Actions\ExportResourceAction::make()
            ->askForFilename()
            ->askForWriterType()
            ->askForColumns([
                'id',
                'title' => 'Fund title',
                'publication_status',
                'description',
                'color_code',
                'selected_report',
            ])
            ->setPostReplaceFieldValuesWhenOnResource(function ($array, \App\Models\Fund $model, $only) {
                if (in_array('selected_report', $only)) {
                    $array['selected_report'] = $model->selectedReport->report_date?->format('Y-m-d');
                }
                return $array;
            }),
    ];
}
```

### Custom specified export

[](#custom-specified-export)

Firstly create custom export class

```
// Exports/PostsWithTagBreaking.php
use Illuminate\Database\Eloquent\Builder;
use Maatwebsite\Excel\Concerns\Exportable;
use Maatwebsite\Excel\Concerns\FromQuery;
use Maatwebsite\Excel\Concerns\WithHeadings;
use Maatwebsite\Excel\Concerns\WithMapping;
use NovaResourceDynamicExport\Export\CustomExport;
use NovaResourceDynamicExport\Tests\Fixtures\Models\Post;

class PostsWithTagBreaking extends CustomExport implements FromQuery, WithHeadings, WithMapping
{
    use Exportable;

    public function query()
    {
        return Post::query()
            ->whereHas('tags', fn (Builder $q) => $q->where('name', 'Breaking'));
    }

    public function headings(): array
    {
        return [
            'Title',
            'content',
        ];
    }

    /**
     * @param Post $row
     */
    public function map($row): array
    {

        return [
            'title'   => $row->title,
            'content' => $row->content,
        ];
    }
}
```

Then add this class using any service provider:

```
// Providers/NovaServiceProvider.php
public function boot(): void
{
    parent::boot();

    CustomResourcesExport::use(PostsWithTagBreaking::class);
}
```

THis is all, not in ExportStoredFile resource index you will see new action to run custom exports

Credits
-------

[](#credits)

- [![Think Studio](https://camo.githubusercontent.com/8e541bece07d503c85a126b5294865faa00e27371048772f566a0cce8c01fd3a/68747470733a2f2f7961726f736c617777772e6769746875622e696f2f696d616765732f73706f6e736f72732f7061636b616765732f6c6f676f2d7468696e6b2d73747564696f2e706e67)](https://think.studio/)

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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

Unknown

Total

1

Last Release

986d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/53f93fa87d58f33d106de6bd5e2946f8a345ebfaee146360746056cb134a15a0?d=identicon)[think.studio](/maintainers/think.studio)

---

Top Contributors

[![yaroslawww](https://avatars.githubusercontent.com/u/23663794?v=4)](https://github.com/yaroslawww "yaroslawww (7 commits)")

---

Tags

configurationexportnova

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/thinkstudio-nova-resource-dynamic-export/health.svg)

```
[![Health](https://phpackages.com/badges/thinkstudio-nova-resource-dynamic-export/health.svg)](https://phpackages.com/packages/thinkstudio-nova-resource-dynamic-export)
```

###  Alternatives

[optimistdigital/nova-sortable

This Laravel Nova package allows you to reorder models in a Nova resource's index view using drag &amp; drop.

2872.1M6](/packages/optimistdigital-nova-sortable)[ebess/advanced-nova-media-library

Laravel Nova tools for managing the Spatie media library.

6123.3M21](/packages/ebess-advanced-nova-media-library)[outl1ne/nova-sortable

This Laravel Nova package allows you to reorder models in a Nova resource's index view using drag &amp; drop.

2861.8M9](/packages/outl1ne-nova-sortable)[eminiarts/nova-tabs

Laravel Nova - Tabs.

4624.1M20](/packages/eminiarts-nova-tabs)[optimistdigital/nova-multiselect-field

A multiple select field for Laravel Nova.

3403.5M7](/packages/optimistdigital-nova-multiselect-field)[spatie/nova-tags-field

A tags field for Nova apps

3021.9M7](/packages/spatie-nova-tags-field)

PHPackages © 2026

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