A media manager to upload media files to multiple storages or select image from Unsplash, URL
omnia-digital/media-manager is a Laravel package for a media manager to upload media files to multiple storages or select image from unsplash, url.
It currently has 6 GitHub stars and 143 downloads on Packagist (latest version 2.0.0).
Install it with composer require omnia-digital/media-manager.
Discover more Laravel packages by omnia-digital
or browse all Laravel packages to compare alternatives.
Last updated
A TALL Stack Media Manager to upload media files to multiple storages or select image from Unsplash, URL
https://user-images.githubusercontent.com/6707194/160046199-91dd3aa3-7687-4394-808e-18057cf5bdbc.mp4
You can install the package via composer:
composer require omnia-digital/media-manager
Add Tailwind CSS classes in tailwind.config.js:
module.exports = {
content: [
...
'./vendor/omnia-digital/media-manager/resources/views/**/*.blade.php',
]
};
You can publish the config file with:
php artisan vendor:publish --tag="media-manager-config"
This is the contents of the published config file:
return [
'storage' => [
'disk' => 'public'
],
'image' => [
'allowed_file_types' => ['png', 'jpg', 'jpeg', 'gif'],
/*
* Max file size in KB.
*/
'max_file_size' => 5000,
],
'unsplash' => [
'access_key' => env('UNSPLASH_ACCESS_KEY'),
'utm_source' => env('APP_NAME')
]
];
Optionally, you can publish the views using
php artisan vendor:publish --tag="media-manager-views"
this.$wire.dispatchTo(
'media-manager',
'media-manager:show',
{
id: 'featured-image',
file: null,
metadata: null
}
);
use Omnia\MediaManager\WithMediaManager;
...
public function showUploader()
{
$this->showFileManager('featured-image', $file, $metadata);
}
You can pass file URL as 2nd parameter so the Media Manager will show that file by default.
use Omnia\MediaManager\WithMediaManager;
...
public function removeFeaturedImage()
{
$this->image = null;
$this->removeFileFromMediaManager();
}
File Selected
When a media file is selected, it will dispatch an event, called media-manager:file-selected
You can listen on that event by using AlpineJS like this:
x-on:media-manager:file-selected.window="setImage"
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
Please review our security policy on how to report security vulnerabilities.
The MIT License (MIT). Please see License File for more information.