PHPackages                             creode/laravel-nova-assets - 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. creode/laravel-nova-assets

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

creode/laravel-nova-assets
==========================

Takes the existing Laravel Assets module and adds functionality to make it work in Nova.

2.8.0(1y ago)1144[3 PRs](https://github.com/creode-modules/laravel-nova-assets/pulls)MITPHPPHP ^8.1CI passing

Since Oct 30Pushed 4mo ago1 watchersCompare

[ Source](https://github.com/creode-modules/laravel-nova-assets)[ Packagist](https://packagist.org/packages/creode/laravel-nova-assets)[ Docs](https://github.com/creode/laravel-nova-assets)[ RSS](/packages/creode-laravel-nova-assets/feed)WikiDiscussions 2.x Synced 1mo ago

READMEChangelog (10)Dependencies (15)Versions (39)Used By (0)

Takes the existing Laravel Assets module and adds functionality to make it work in Nova.
========================================================================================

[](#takes-the-existing-laravel-assets-module-and-adds-functionality-to-make-it-work-in-nova)

[![Latest Version on Packagist](https://camo.githubusercontent.com/d1a1fc59b7c6ecd7971b68bdef1eefcfeb6a733936d6e19ac43e55d76026d6ca/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6372656f64652f6c61726176656c2d6e6f76612d6173736574732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/creode/laravel-nova-assets)[![GitHub Tests Action Status](https://camo.githubusercontent.com/e559637f9e246a1913ec9396860356c5bf2d50109472a12525cbc8b5e93726d3/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6372656f64652d6d6f64756c65732f6c61726176656c2d6e6f76612d6173736574732f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/creode-modules/laravel-nova-assets/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/45168d0cb57269a31a0d40358a9bc8008440aba378506f4e1bcfd47d9847de14/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6372656f64652d6d6f64756c65732f6c61726176656c2d6e6f76612d6173736574732f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/creode-modules/laravel-nova-assets/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/071f673195e4673522c625d575b6beeb17c3768c8085982c34fb6ae70a020e5a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6372656f64652f6c61726176656c2d6e6f76612d6173736574732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/creode/laravel-nova-assets)

Takes the existing Laravel Assets module and adds hookable functionality to make it work in Nova.

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

[](#installation)

You can install the package via composer:

```
composer require creode/laravel-nova-assets
```

You can publish the config file with:

```
php artisan vendor:publish --tag="nova-assets-config"
```

This is the contents of the published config file:

```
// config for Creode/LaravelNovaAssets
return [
    /*
    |--------------------------------------------------------------------------
    | Default Upload Accepted Mime Types
    |--------------------------------------------------------------------------
    |
    | This value contains the default bulk fields which will be rendered when
    | doing a bulk upload. You can add or remove fields as you wish.
    |
    */

    'default_upload_accepted_mime_types' => [
        'image/*',
        'application/zip',
        'zip',
        'application/pdf',
    ],

    /*
    |--------------------------------------------------------------------------
    | Allowed Zip File Extensions
    |--------------------------------------------------------------------------
    |
    | This value contains an array of allowed file extensions which will be
    | pulled when extracting zip files during a bulk upload action.
    |
    */

    'accepted_zip_file_extensions' => [
        'png',
        'jpeg',
        'jpg',
        'webp',
        'pdf',
    ],

    /*
    |--------------------------------------------------------------------------
    | Asset Policy
    |--------------------------------------------------------------------------
    |
    | This value contains the policy which will be used when verifying if a
    | user can perform an action on an asset. You can change this to your own
    | policy if you wish.
    |
    */

    'asset_policy' => \Creode\LaravelNovaAssets\Policies\AssetPolicy::class,

    /*
    |--------------------------------------------------------------------------
    | Image Driver
    |--------------------------------------------------------------------------
    |
    | This value contains the image driver which will be used when generating
    | thumbnails. You can change this to your own driver if you wish. Drivers
    | must implement the Intervention\Image\Interfaces\DriverInterface
    | interface.
    |
    | This can be one of the following:
    | Intervention\Image\Drivers\Gd\Driver::class
    | Intervention\Image\Drivers\Imagick\Driver::class
    |
    */
    'image_driver' => Intervention\Image\Drivers\Gd\Driver::class,

    /*
    |--------------------------------------------------------------------------
    | Traffic Cop
    |--------------------------------------------------------------------------
    |
    | Indicates whether Nova should check for modifications between viewing
    | and updating a resource.
    |
    */
    'traffic_cop' => true,

    /*
    |--------------------------------------------------------------------------
    | Show Max Upload Size
    |--------------------------------------------------------------------------
    |
    | Indicates whether to show the max upload size in the asset resource.
    |
    */
    'show_max_upload_size' => false,
];
```

Usage
-----

[](#usage)

The purpose of this module is to use the existing assets model class and wrap it into a Nova resource. This allows us to use the existing functionality of the assets module in Nova. We use some hookable functionality which is documented below that gives any child modules the ability to add custom fields and actions to the resource.

### Registering Custom Resource Fields

[](#registering-custom-resource-fields)

You can register custom resource fields to appear in both the standard Nova pages (detail, edit, create) and the Bulk Asset Upload action. To do this you need to listen for the `DefineAssetFieldsEvent` event and add your fields to the `$fields` array. For a full list of Nova fields please look at the [Nova documentation](https://nova.laravel.com/docs/4.0/resources/fields.html).

```
Event::listen(function (DefineAssetFieldsEvent $event) {
    $event->fields[] = Text::make('Folder', 'folder_id');
});
```

### Registering Custom Resource Actions

[](#registering-custom-resource-actions)

You can register custom resource actions to appear on the Asset resource. To do this you need to listen for the `DefineAssetActionsEvent` event and add your actions to the `$actions` array. These just use Nova's standard Actions functionality. For details about defining actions please look at the [Nova documentation](https://nova.laravel.com/docs/4.0/actions/defining-actions.html).

```
Event::listen(function (DefineAssetActionsEvent $event) {
    $event->actions[] = TestActionClass::make();
});
```

### Registering Custom Bulk Asset Fields

[](#registering-custom-bulk-asset-fields)

You can register custom bulk asset fields to appear on the Bulk Asset Upload action. To do this you need to listen for the `DefineBulkAssetFieldsEvent` event and add your fields to the `$fields` array. For a full list of Nova fields please look at the [Nova documentation](https://nova.laravel.com/docs/4.0/resources/fields.html).

```
Event::listen(function (DefineBulkAssetFieldsEvent $event) {
    $event->fields[] = Text::make('Folder', 'folder_id');
});
```

### Insert a field after another one

[](#insert-a-field-after-another-one)

As of version `1.4.0` of this module, you can now run a helper function to add an attribute in after another one. This can be done by running the following:

```
Event::listen(function (DefineAssetFieldsEvent $event) {
    $event->addFieldAfter('name', Text::make('Folder', 'folder_id'));
});
```

This will then inject the field directly after the other. This is useful if you want to add a field after a specific field but don't want to have to worry about the order of the fields in the array. The only caveat here is that if the field with the provided first attribute doesn't exist, it will not add the field.

Permissions
-----------

[](#permissions)

This module exposes a new permission seeder class which will need to be published to your application in order to grant permissions to the new resource. To do this you need to run the following command:

```
php artisan vendor:publish --tag="nova-assets-seeders"
```

This will create a new `AssetRoleAndPermissionSeeder.php` file within your `database/seeders` directory. This will need to be run in order to grant permissions to the new resource. You can run this by running the following command:

```
php artisan db:seed --class=AssetRoleAndPermissionSeeder
```

You should now see in your database a collection of permissions and a new role called `asset-manager`. This role will have all the permissions required to manage assets. Before running this, it requires the setup of any tables for the `spatie/laravel-permissions` package. Please see the [documentation](https://spatie.be/docs/laravel-permission/v6/installation-laravel) for more information.

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Creode](https://github.com/creode)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance63

Regular maintenance activity

Popularity12

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 57.4% 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 ~25 days

Recently: every ~111 days

Total

33

Last Release

124d ago

Major Versions

1.x-dev → 2.0.02023-12-12

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/8133041?v=4)[Creode](/maintainers/creode)[@creode](https://github.com/creode)

---

Top Contributors

[![jaymeh](https://avatars.githubusercontent.com/u/18261676?v=4)](https://github.com/jaymeh "jaymeh (89 commits)")[![liam-spedding](https://avatars.githubusercontent.com/u/111750536?v=4)](https://github.com/liam-spedding "liam-spedding (30 commits)")[![creode-dev](https://avatars.githubusercontent.com/u/19706903?v=4)](https://github.com/creode-dev "creode-dev (15 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (12 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (9 commits)")

---

Tags

laravelcreodelaravel-nova-assets

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/creode-laravel-nova-assets/health.svg)

```
[![Health](https://phpackages.com/badges/creode-laravel-nova-assets/health.svg)](https://phpackages.com/packages/creode-laravel-nova-assets)
```

###  Alternatives

[spatie/laravel-data

Create unified resources and data transfer objects

1.7k28.9M627](/packages/spatie-laravel-data)[spatie/laravel-livewire-wizard

Build wizards using Livewire

4061.0M4](/packages/spatie-laravel-livewire-wizard)[hirethunk/verbs

An event sourcing package that feels nice.

513162.9k6](/packages/hirethunk-verbs)[worksome/exchange

Check Exchange Rates for any currency in Laravel.

123544.7k](/packages/worksome-exchange)[ralphjsmit/livewire-urls

Get the previous and current url in Livewire.

82270.3k4](/packages/ralphjsmit-livewire-urls)[hydrat/filament-table-layout-toggle

Filament plugin adding a toggle button to tables, allowing user to switch between Grid and Table layouts.

6292.3k1](/packages/hydrat-filament-table-layout-toggle)

PHPackages © 2026

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