PHPackages                             dominservice/laravel-media-kit - 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. [Image &amp; Media](/categories/media)
4. /
5. dominservice/laravel-media-kit

ActiveLibrary[Image &amp; Media](/categories/media)

dominservice/laravel-media-kit
==============================

Lekki pipeline obrazów i wideo dla Laravela (shared hosting ready): warianty, AVIF/WebP, &lt;picture&gt;, eager/lazy generacja, narzędzia CLI.

1.2.0(1mo ago)091MITPHPPHP &gt;=8.1

Since Oct 17Pushed 1mo agoCompare

[ Source](https://github.com/dominservice/laravel-media-kit)[ Packagist](https://packagist.org/packages/dominservice/laravel-media-kit)[ RSS](/packages/dominservice-laravel-media-kit/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (6)Dependencies (14)Versions (7)Used By (1)

Dominservice Laravel Media Kit
==============================

[](#dominservice-laravel-media-kit)

[![Latest Version on Packagist](https://camo.githubusercontent.com/891db0d954c3be35c1807918cc769b4bd4ecce585c13900abfe4bd55c33d04ac/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f646f6d696e736572766963652f6c61726176656c2d6d656469612d6b69742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/dominservice/laravel-media-kit)[![Total Downloads](https://camo.githubusercontent.com/33a8517da6a44dfa71d3c9d300ba212bba7166ad1ea0e7eb419c268fdf5dd0f4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f646f6d696e736572766963652f6c61726176656c2d6d656469612d6b69742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/dominservice/laravel-media-kit)[![License](https://camo.githubusercontent.com/df0403a606827ad44bd74e33f655198875fb2850f57b7e2613dad739c4383683/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f646f6d696e736572766963652f6c61726176656c2d6d656469612d6b69742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/dominservice/laravel-media-kit)

`dominservice/laravel-media-kit` is a reusable media layer for Laravel applications that need image and video processing, responsive variants and a shared admin media library.

It is designed to work well in two modes at once:

- as a clean standalone media toolkit,
- as the media backbone for `dominservice/laravel-cms` and larger modular systems.

Key Features
------------

[](#key-features)

- Laravel 9–13 support,
- responsive image variants in AVIF, WebP, JPEG and PNG,
- lazy or eager variant generation,
- media kinds for domain-specific collections,
- shared media library for admin panels,
- attach existing assets without re-uploading the same file,
- image and video support,
- configurable admin routes, middleware, permissions and layout integration,
- publishable package views for host-project theming,
- CDN and signed URL support.

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

[](#installation)

```
composer require dominservice/laravel-media-kit

php artisan vendor:publish --provider="Dominservice\MediaKit\MediaKitServiceProvider" --tag=mediakit-config
php artisan vendor:publish --provider="Dominservice\MediaKit\MediaKitServiceProvider" --tag=mediakit-migrations
php artisan vendor:publish --provider="Dominservice\MediaKit\MediaKitServiceProvider" --tag=mediakit-views

php artisan migrate
```

Core Usage
----------

[](#core-usage)

### Add media to a model

[](#add-media-to-a-model)

```
use Dominservice\MediaKit\Traits\HasMedia;
use Dominservice\MediaKit\Traits\HasMediaKinds;

class Post extends Model
{
    use HasMedia;
    use HasMediaKinds;
}
```

```
$post->addMedia($request->file('cover'), 'featured');
```

### Reuse an existing asset

[](#reuse-an-existing-asset)

```
$post->attachExistingMedia($mediaAsset, 'featured');
$post->attachExistingMedia($uuid, 'gallery', 'keep');
```

This is useful for shared media libraries, CMS block builders and projects where the same asset may be used in many places.

Shared Admin Media Library
--------------------------

[](#shared-admin-media-library)

The package now includes an optional admin media library module.

It provides:

- reusable routes and controllers inside the package,
- upload, list and delete actions,
- a dedicated `media_libraries` table,
- publishable views,
- flexible route, permission and layout integration.

### Admin configuration

[](#admin-configuration)

```
'admin' => [
    'enabled' => true,
    'prefix' => 'admin/media',
    'route_name_prefix' => 'admin.media.',
    'middleware' => ['web', 'auth'],
    'permissions' => [
        'view' => 'media.view',
        'upload' => 'media.upload',
        'delete' => 'media.delete',
    ],
    'layout' => [
        'mode' => 'extends',
        'view' => 'layouts.admin',
        'section' => 'content',
        'component' => 'admin-layout',
    ],
    'library' => [
        'view' => 'mediakit::admin.library.index',
        'default_key' => 'global',
        'default_name' => 'Main media library',
        'default_collection' => 'library',
        'per_page' => 18,
    ],
],
```

This keeps the route and controller logic inside the package while allowing the project to override only the Blade views.

CMS Integration
---------------

[](#cms-integration)

`dominservice/laravel-cms` can use Media Kit as its media backend.

Recommended setup:

- keep media library routes and controller inside `laravel-media-kit`,
- keep CMS content logic inside `laravel-cms`,
- publish views from both packages,
- override the views in the project to match the design system.

This gives you a reusable package architecture and avoids duplicating media logic per project.

Kinds and Variants
------------------

[](#kinds-and-variants)

Kinds let you define domain-aware media contracts such as `avatar`, `gallery`, `video_avatar` or `video_poster`.

```
'kinds' => [
    'avatar' => [
        'collection' => 'avatar',
        'display' => 'lg',
        'variants' => ['thumb', 'sm', 'md', 'lg'],
    ],
    'video_avatar' => [
        'collection' => 'video',
        'renditions' => ['hd', 'sd', 'mobile'],
        'poster_kind' => 'video_poster',
    ],
],
```

Views and Theming
-----------------

[](#views-and-theming)

The package is prepared for reuse across projects.

```
php artisan vendor:publish --provider="Dominservice\MediaKit\MediaKitServiceProvider" --tag=mediakit-views
```

Recommended approach:

- keep routes, controller actions, models and services in the package,
- publish the views,
- override only the UI layer in the host project.

This is especially useful when pairing Media Kit with a custom CMS or admin template such as Metronic.

Extensibility
-------------

[](#extensibility)

The package is intentionally configurable instead of hardcoded.

You can override:

- models,
- route prefix and route names,
- admin middleware and permissions,
- layout mode and view integration,
- accepted file extensions,
- kinds and variants,
- published views.

This allows each project to adapt the package without forking the package logic.

License
-------

[](#license)

MIT

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance92

Actively maintained with recent releases

Popularity5

Limited adoption so far

Community5

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

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 ~33 days

Recently: every ~42 days

Total

6

Last Release

40d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9d67c041316385020aafb7eef9f11971d6fad80a11a44f4078273bda6890722d?d=identicon)[dominservice](/maintainers/dominservice)

### Embed Badge

![Health badge](/badges/dominservice-laravel-media-kit/health.svg)

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

###  Alternatives

[laravel/cashier

Laravel Cashier provides an expressive, fluent interface to Stripe's subscription billing services.

2.5k25.9M107](/packages/laravel-cashier)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9682.1M97](/packages/roots-acorn)[laravel/pulse

Laravel Pulse is a real-time application performance monitoring tool and dashboard for your Laravel application.

1.7k12.1M99](/packages/laravel-pulse)[laravel/cashier-paddle

Cashier Paddle provides an expressive, fluent interface to Paddle's subscription billing services.

264778.4k3](/packages/laravel-cashier-paddle)[pressbooks/pressbooks

Pressbooks is an open source book publishing tool built on a WordPress multisite platform. Pressbooks outputs books in multiple formats, including PDF, EPUB, web, and a variety of XML flavours, using a theming/templating system, driven by CSS.

44643.1k1](/packages/pressbooks-pressbooks)[masterro/laravel-mail-viewer

Easily view in browser outgoing emails.

6392.1k](/packages/masterro-laravel-mail-viewer)

PHPackages © 2026

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