Skip to content

timgavin/laravel-medialibrary

This branch is 1 commit ahead of, 363 commits behind spatie/laravel-medialibrary:main.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ce8586b · Jun 17, 2022
Mar 21, 2022
Oct 22, 2020
Mar 22, 2022
May 5, 2022
Jun 17, 2022
Oct 30, 2020
May 23, 2022
May 19, 2022
Mar 9, 2020
Apr 5, 2022
May 5, 2022
Sep 7, 2021
May 23, 2022
Oct 10, 2017
Mar 21, 2022
Feb 16, 2022
Feb 22, 2022
May 5, 2022
Jan 14, 2022
Sep 8, 2020

Repository files navigation

Social Card of Laravel Media Library

Associate files with Eloquent models

Latest Version GitHub Workflow Status Total Downloads

This package can associate all sorts of files with Eloquent models. It provides a simple API to work with. To learn all about it, head over to the extensive documentation.

Here are a few short examples of what you can do:

$newsItem = News::find(1);
$newsItem->addMedia($pathToFile)->toMediaCollection('images');

It can handle your uploads directly:

$newsItem->addMedia($request->file('image'))->toMediaCollection('images');

Want to store some large files on another filesystem? No problem:

$newsItem->addMedia($smallFile)->toMediaCollection('downloads', 'local');
$newsItem->addMedia($bigFile)->toMediaCollection('downloads', 's3');

The storage of the files is handled by Laravel's Filesystem, so you can use any filesystem you like. Additionally the package can create image manipulations on images and pdfs that have been added in the media library.

Spatie is a webdesign agency in Antwerp, Belgium. You'll find an overview of all our open source projects on our website.

Support us

We invest a lot of resources into creating best in class open source packages. You can support us by buying one of our paid products.

We highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on our contact page. We publish all received postcards on our virtual postcard wall.

Documentation

You'll find the documentation on https://spatie.be/docs/laravel-medialibrary.

Find yourself stuck using the package? Found a bug? Do you have general questions or suggestions for improving the media library? Feel free to create an issue on GitHub, we'll try to address it as soon as possible.

If you've found a bug regarding security please mail security@spatie.be instead of using the issue tracker.

Testing

You can run the tests with:

vendor/bin/phpunit

Upgrading

Please see UPGRADING for details.

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email security@spatie.be instead of using the issue tracker.

Credits

A big thank you to Nicolas Beauvais for helping out with the issues on this repo.

And a special thanks to Caneco for the logo ✨

Alternatives

License

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

Packages

No packages published

Languages

  • PHP 99.7%
  • Blade 0.3%