PHP code example of omnia-digital / media-manager
1. Go to this page and download the library: Download omnia-digital/media-manager library . Choose the download type require .
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
omnia-digital / media-manager example snippets
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')
]
];
use Omnia\MediaManager\WithMediaManager;
...
public function showUploader()
{
$this->showFileManager('featured-image', $file, $metadata);
}
use Omnia\MediaManager\WithMediaManager;
...
public function removeFeaturedImage()
{
$this->image = null;
$this->removeFileFromMediaManager();
}
js
module.exports = {
content: [
...
'./vendor/omnia-digital/media-manager/resources/views/**/*.blade.php',
]
};
bash
php artisan vendor:publish --tag="media-manager-config"
bash
php artisan vendor:publish --tag="media-manager-views"
js
this.$wire.dispatchTo(
'media-manager',
'media-manager:show',
{
id: 'featured-image',
file: null,
metadata: null
}
);