PHPackages                             q2softwarenl/spatie-medialibrary-manager - 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. [File &amp; Storage](/categories/file-storage)
4. /
5. q2softwarenl/spatie-medialibrary-manager

ActiveLibrary[File &amp; Storage](/categories/file-storage)

q2softwarenl/spatie-medialibrary-manager
========================================

A file manager for Laravel applications using Spatie Laravel Medialibrary.

0.4.0(1mo ago)166MITBladePHP ^8.2

Since Apr 28Pushed 1mo agoCompare

[ Source](https://github.com/q2softwarenl/spatie-medialibrary-manager)[ Packagist](https://packagist.org/packages/q2softwarenl/spatie-medialibrary-manager)[ RSS](/packages/q2softwarenl-spatie-medialibrary-manager/feed)WikiDiscussions main Synced 1mo ago

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

Spatie Medialibrary Manager
===========================

[](#spatie-medialibrary-manager)

A file manager for Laravel applications using the famous Spatie [Laravel Medialibrary package](https://github.com/spatie/laravel-medialibrary).

**Features**

- Manage multiple media collections via one interactive GUI
- Manage singlefile and multifile collections
- Download, rename or delete media
- Move media between collections
- Manage policies via native Laravel Policies or set policies directly on the component.

[![Manager](./manager.png)](./manager.png)

**PRO-features**

- Set policies for individual collections, rather than just the full model.
- Add custom actions to collections and files.
- Upload multiple versions of the same file.
- Alternative GUI for single file collections.

**Roadmap**

**Note!** We are currently in active development of "Spatie Medialibrary Manager Pro". We plan to publish a free version here on Github. There are a few things that need to be fixed before we can publish the package.

- **alpha** Bug: Decide if thumbs are a requirement
- **alpha** Refactor: Use json translation as much as possible and avoid legacy php arrays
- **beta** Feature: Filesize validation
- **beta** Feature: Add active folder to url.
- **beta** Improve single file collections.
- **v1.1** Add support for darkmode.

The alpha version is released at the end of April. The beta version is scheduled for release at the end of May.

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

[](#requirements)

- Laravel 10+
- Tailwindcss 4
- Spatie Medialibrary 11+

Base installation
-----------------

[](#base-installation)

Please note that this package requires a installation of Laravel Media Library and that the Laravel Models are prepared. Do this first if you haven't done so already.

- [How to setup Spatie Laravel Medialibrary?](https://spatie.be/docs/laravel-medialibrary/v11/installation-setup)
- [How to prepare Models?](https://spatie.be/docs/laravel-medialibrary/v11/basic-usage/preparing-your-model)

Spatie Medialibrary Manager can be installed via Composer. To do so, follow the basic installation instructions below.

```
composer require q2softwarenl/spatie-medialibrary-manager
```

Add the manager javascript to your app `resources/js/app.js` file:

```
import './bootstrap';
+ import './../../vendor/q2softwarenl/spatie-medialibrary-manager/resources/js/manager';
```

Import the manager styles to your app `app.css` file and run `npm run build`:

```
@import 'tailwindcss';

@source '../../vendor/laravel/framework/src/Illuminate/Pagination/resources/views/*.blade.php';
@source '../../storage/framework/views/*.php';
@source '../**/*.blade.php';
@source '../**/*.js';

+ @import './../../vendor/q2softwarenl/spatie-medialibrary-manager/resources/css/manager.css';
+ @import './../../vendor/q2softwarenl/spatie-medialibrary-manager/resources/css/theme/default.css';
```

Configure the model policy before you can use the manager. After that, you can configure the manager with custom language files, custom configuration and display. Use the following policies for each model that has media and implements the Spatie Medialibrary Manager:

- `spatieMedialibraryManagerEditMedia`
- `spatieMedialibraryManagerDeleteMedia`
- `spatieMedialibraryManagerMoveMedia`
- `spatieMedialibraryManagerUploadMedia`
- `spatieMedialibraryManagerDownloadMedia`
- `spatieMedialibraryManagerDownloadAllMedia`
- [Take a look at the UserPolicy.php sample file](./examples/UserPolicy.php)
- [Policies can be overruled to be `false`](#overrule-policies) (optional)

Add the component to a view. The manager will auto-detect registered mediacollections after you have prepared your models. [How to register a media collection?](#register-a-media-collection)

```

```

**Only required for PRO users**: Follow the steps in the PRO documentation "Preparing Laravel Models"-section.

Register a media collection
---------------------------

[](#register-a-media-collection)

Create a function called `registerMediaCollections` in the model where you want to use media. In this example we are using the `User` model.

Example:

```
use Spatie\MediaLibrary\InteractsWithMedia;
use Spatie\MediaLibrary\HasMedia;

class User extends Authenticatable implements HasMedia {

    use InteractsWithMedia;

    public function registerMediaCollections() : void
    {
        $this->addMediaCollection('avatar')->singleFile();
        $this->addMediaCollection('images');
    }

}
```

Language
--------

[](#language)

Naming of collections is out of the box translated. Create a file `lang\en\mediaCollections.php` and add the table name of the model:

```
return [
    'users' => [
        'avatar' => 'Avatar'
        'images' => 'Pictures'
    ]
];
```

Spatie Medialibrary Manager uses default translation strings. You can edit this in you applications `lang\.json` file.

Publish the language file to set other translations:

```
vendor:publish --provider="Q2softwarenl\SpatieMedialibraryManager\SpatieMedialibraryManagerServiceProvider" --tag="lang"
```

Policies
--------

[](#policies)

[Take a look at the UserPolicy.php sample file](./examples/UserPolicy.php).

### Overrule policies

[](#overrule-policies)

Sometimes, you want the MediaManager to be readonly or download only, etc., even if the user is according to policies able to do write actions. You can overrule policies that return `true`:

- `canUpload` (default: true, fallback to policy) (if set to `false`, this prevents all upload actions)
- `canDownload` (default: true, fallback to policy) (if set to `false`, this prevents all download actions)
- `canEdit` (default: true, fallback to policy) (if set to `false`, this prevents all rename actions)
- `canMove` (default: true, fallback to policy) (if set to `false`, this prevents all move actions)
- `canDelete` (default: true, fallback to policy) (if set to `false`, this prevents all delete actions)

Example:

```

```

**Note!** You cannot force `true` if the policy returns `false`. Make sure your policy covers the basics and manage functional policies via the component attributes.

Change the appearance
---------------------

[](#change-the-appearance)

You can set a background by wrapping the component in a `div`:

```

```

By default, the manager doesn't have a height or max-heigth. It will get as big as the content requires. You can add CSS-classes to modify the inner height of the component:

```

```

###  Health Score

41

—

FairBetter than 89% of packages

Maintenance89

Actively maintained with recent releases

Popularity12

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity47

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

Every ~27 days

Recently: every ~66 days

Total

13

Last Release

57d ago

PHP version history (2 changes)0.1PHP ^8.0.2

0.4.0PHP ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/61d06c885745a581b7313ca440075d14611fa5dc7840e43031d2fd2a056a50e4?d=identicon)[djl997](/maintainers/djl997)

---

Top Contributors

[![djl997](https://avatars.githubusercontent.com/u/27086857?v=4)](https://github.com/djl997 "djl997 (30 commits)")

### Embed Badge

![Health badge](/badges/q2softwarenl-spatie-medialibrary-manager/health.svg)

```
[![Health](https://phpackages.com/badges/q2softwarenl-spatie-medialibrary-manager/health.svg)](https://phpackages.com/packages/q2softwarenl-spatie-medialibrary-manager)
```

###  Alternatives

[namu/wirechat

A Laravel Livewire messaging app for teams with private chats and group conversations.

54324.5k](/packages/namu-wirechat)[nasirkhan/laravel-starter

A CMS like modular Laravel starter project.

1.4k2.7k](/packages/nasirkhan-laravel-starter)[rahulhaque/laravel-filepond

Use FilePond the Laravel way

261114.4k2](/packages/rahulhaque-laravel-filepond)

PHPackages © 2026

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