PHPackages                             fomvasss/laravel-medialibrary-extension - 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. fomvasss/laravel-medialibrary-extension

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

fomvasss/laravel-medialibrary-extension
=======================================

Extension for use spatie/laravel-medialibrary

6.3.2(2w ago)43.2k↓38.9%1MITPHP

Since Nov 25Pushed 2w ago1 watchersCompare

[ Source](https://github.com/fomvasss/laravel-medialibrary-extension)[ Packagist](https://packagist.org/packages/fomvasss/laravel-medialibrary-extension)[ Fund](https://send.monobank.ua/jar/5xsqtHvVrY)[ Fund](https://ko-fi.com/fomvasss)[ RSS](/packages/fomvasss-laravel-medialibrary-extension/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependencies (8)Versions (46)Used By (0)

Laravel Medialibrary Extension
==============================

[](#laravel-medialibrary-extension)

[![License](https://camo.githubusercontent.com/f7ebe368ae5b9e5768e69c6b698b5f05da9d2641763050c91afa0a39c93f0584/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f666f6d76617373732f6c61726176656c2d6d656469616c6962726172792d657874656e73696f6e2e7376673f7374796c653d666f722d7468652d6261646765)](https://packagist.org/packages/fomvasss/laravel-medialibrary-extension)[![Build Status](https://camo.githubusercontent.com/0e6c2a242687f952c29a0581d8934377c176143eed537e0b023de54f4cd9f83e/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f666f6d76617373732f6c61726176656c2d6d656469616c6962726172792d657874656e73696f6e2e7376673f7374796c653d666f722d7468652d6261646765)](https://github.com/fomvasss/laravel-medialibrary-extension)[![Latest Stable Version](https://camo.githubusercontent.com/9c773ace292382e6c65ac1bb3c1d93726d8761bf286b10dcd4aced8a085ee622/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f666f6d76617373732f6c61726176656c2d6d656469616c6962726172792d657874656e73696f6e2e7376673f7374796c653d666f722d7468652d6261646765)](https://packagist.org/packages/fomvasss/laravel-medialibrary-extension)[![Total Downloads](https://camo.githubusercontent.com/1376eef7ece24f5cd7995bff88ec2913e8d1134b944ffdf7abfb0b5accf01417/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f666f6d76617373732f6c61726176656c2d6d656469616c6962726172792d657874656e73696f6e2e7376673f7374796c653d666f722d7468652d6261646765)](https://packagist.org/packages/fomvasss/laravel-medialibrary-extension)[![Quality Score](https://camo.githubusercontent.com/b491b755ee11befcc4e15fcf5ed0ecaa542c5329f1d016bc0b244c38c44e3d9f/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f666f6d76617373732f6c61726176656c2d6d656469616c6962726172792d657874656e73696f6e2e7376673f7374796c653d666f722d7468652d6261646765)](https://scrutinizer-ci.com/g/fomvasss/laravel-medialibrary-extension)

Support
-------

[](#support)

If this package is useful to you, consider supporting its development:

[![Monobank](https://camo.githubusercontent.com/f4ca1cf4fd0a99ddfed314cb8f65140d8e83e324bd7c1f8476c52fe4ee6b25fd/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f446f6e6174652d4d6f6e6f62616e6b2d626c61636b)](https://send.monobank.ua/jar/5xsqtHvVrY)[![Ko-Fi](https://camo.githubusercontent.com/10764ec41c79959f08ccaf3e066c7a76c371961b1b1ff5b5f2a33aceef6e857a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f446f6e6174652d4b6f2d2d66692d4646354535423f6c6f676f3d6b6f2d6669266c6f676f436f6c6f723d7768697465)](https://ko-fi.com/fomvasss)[![USDT TRC20](https://camo.githubusercontent.com/214b4dc05bedda1c5129726b4450ef7f672ce6637865f8a8be83c03582bfdce8/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f446f6e6174652d5553445425323054524332302d3236413137423f6c6f676f3d746574686572266c6f676f436f6c6f723d7768697465)](https://link.trustwallet.com/send?coin=195&address=THLgp6DxiAtbNHvgnKV56vk1L38UuUagKf&token_id=TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t)

> USDT TRC20 address: `THLgp6DxiAtbNHvgnKV56vk1L38UuUagKf`

Extensions to the file management functionality of package [spatie/laravel-medialibrary](https://github.com/spatie/laravel-medialibrary)

---

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

[](#installation)

```
composer require fomvasss/laravel-medialibrary-extension
```

Publish `spatie/laravel-medialibrary`

```
php artisan vendor:publish --provider="Spatie\MediaLibrary\MediaLibraryServiceProvider" --tag="medialibrary-migrations"
php artisan vendor:publish --provider="Spatie\MediaLibrary\MediaLibraryServiceProvider" --tag="medialibrary-config"
```

Publish `fomvasss/laravel-medialibrary-extension`

```
php artisan vendor:publish --provider="Fomvasss\MediaLibraryExtension\ServiceProvider"
```

Run migration:

```
php artisan migrate
```

Integration in Eloquent models
------------------------------

[](#integration-in-eloquent-models)

Implements interface:

```
Fomvasss\MediaLibraryExtension\HasMedia\HasMedia

```

Usage in Eloquent models trait:

```
Fomvasss\MediaLibraryExtension\HasMedia\InteractsWithMedia

```

Usage example
-------------

[](#usage-example)

In Your model: `app/Models/Article.php`:

```
