PHPackages                             codprez/laravel-media-library - 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. codprez/laravel-media-library

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

codprez/laravel-media-library
=============================

Media library with upload, variants, and selector UI for Laravel + Inertia + React.

v1.6.8(1mo ago)2258MITTypeScriptPHP ^8.2

Since Apr 13Pushed 1mo agoCompare

[ Source](https://github.com/obalaweb/laravel-media-library)[ Packagist](https://packagist.org/packages/codprez/laravel-media-library)[ RSS](/packages/codprez-laravel-media-library/feed)WikiDiscussions main Synced 3w ago

READMEChangelog (10)Dependencies (8)Versions (27)Used By (0)

Laravel Media Library
=====================

[](#laravel-media-library)

A robust media library management system for Laravel applications using Inertia.js and React. It provides a full-featured media manager with upload capabilities, variants (thumbnails), and a selector UI.

Features
--------

[](#features)

- **Media Management**: Upload, rename, and delete media files.
- **Bulk Uploads**: Upload multiple files in a single request.
- **Variant Generation**: Automatic generation of thumbnails and webp variants (expandable).
- **Inertia/React Integration**: Ready-to-use components for selecting and managing media in your admin panel.
- **Filtering**: Filter media by type (image, video, document) and search by name.
- **Multi-delete**: Select and remove multiple files at once.
- **Google Drive Import (Public Links)**: Paste a public file/folder link, preview files, select some or all, and import in the background.

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

[](#requirements)

- PHP 8.2+
- Laravel 12.x | 13.x
- Inertia.js (React)

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

[](#installation)

You can install the package via composer:

```
composer require codprez/laravel-media-library
```

### Publish Configuration and Migrations

[](#publish-configuration-and-migrations)

```
php artisan vendor:publish --tag="media-library-config"
php artisan vendor:publish --tag="media-library-migrations"
```

### Run Migrations

[](#run-migrations)

```
php artisan migrate
```

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

[](#configuration)

The configuration file is located at `config/media-library.php`. Here you can define the user model for relationships:

```
return [
    'user_model' => \App\Models\User::class,
    'disk' => 'public',
    'google_drive' => [
        'api_key' => env('GOOGLE_DRIVE_API_KEY'),
    ],
];
```

### Google Drive Import Setup

[](#google-drive-import-setup)

To import public Google Drive folders, set an API key:

```
GOOGLE_DRIVE_API_KEY=your_google_api_key
```

Then run migrations so import tracking columns/tables exist:

```
php artisan migrate
```

Usage
-----

[](#usage)

### Backend

[](#backend)

The package provides a `Media` model and a `MediaController`. By default, it uses the `public` disk for storage.

#### Handling Uploads

[](#handling-uploads)

The `MediaController` includes a `store` method that handles file uploads and automatically generates metadata.

```
// In your routes/web.php or routes/api.php
use Codprez\MediaLibrary\Http\Controllers\MediaController;

Route::post('/admin/media', [MediaController::class, 'store'])->name('admin.media.store');
```

### Frontend (Inertia + React)

[](#frontend-inertia--react)

The package includes React components located in `resources/js`. You can import and use them in your Inertia pages.

#### Component Example

[](#component-example)

```
import { MediaSelector } from 'codprez/laravel-media-library';

function MyForm() {
    return (
         console.log(media)}
            multiple={false}
        />
    );
}
```

License
-------

[](#license)

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

###  Health Score

45

—

FairBetter than 91% of packages

Maintenance89

Actively maintained with recent releases

Popularity14

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 97.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 ~2 days

Total

26

Last Release

56d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/55b8d54ccbfac6a5169aae8b947c1e9f5bf2df45dbc9752d94abd3dc52da14a6?d=identicon)[obalaweb](/maintainers/obalaweb)

---

Top Contributors

[![obalaweb](https://avatars.githubusercontent.com/u/49390404?v=4)](https://github.com/obalaweb "obalaweb (34 commits)")[![jivanobala-source](https://avatars.githubusercontent.com/u/268674462?v=4)](https://github.com/jivanobala-source "jivanobala-source (1 commits)")

---

Tags

laravellibrarymediainertiauploadreactMedia Manager

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/codprez-laravel-media-library/health.svg)

```
[![Health](https://phpackages.com/badges/codprez-laravel-media-library/health.svg)](https://phpackages.com/packages/codprez-laravel-media-library)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3345.3M347](/packages/psalm-plugin-laravel)[api-platform/laravel

API Platform support for Laravel

58174.6k17](/packages/api-platform-laravel)[simplestats-io/laravel-client

Server-side analytics for Laravel that follows the full funnel from visit to registration to payment, attributed to the channel that drove it. Revenue, MRR, churn and ad-spend profit (ROAS/CAC) per channel. GDPR compliant, ad-blocker proof.

5022.6k](/packages/simplestats-io-laravel-client)

PHPackages © 2026

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