@febalist/laravel-media
v6.0.0
Published
```bash composer require febalist/laravel-media php artisan vendor:publish --provider 'Febalist\Laravel\Media\MediaServiceProvider' php artisan migrate ```
Downloads
5
Readme
composer require febalist/laravel-media
php artisan vendor:publish --provider 'Febalist\Laravel\Media\MediaServiceProvider'
php artisan migrate
MEDIA_DISK=cloud
MEDIA_PATH=media
MEDIA_QUEUE=media
use HasMedia;
public function mediaConvert(MediaConverter $converter)
{
$converter->optimize();
$converter->conversion('thumb')->fit_crop(800, 450);
}
Vue input
Vue.use(require('./../../vendor/febalist/laravel-media/src/index'));
{{ $model->mediaInput(['multiple' => true, 'mime' => 'image/*']) }}
$model->updateMediaFromInput();
JS helpers
const media = require('./../../vendor/febalist/laravel-media/src/media');
media.select_images().then(files => {
media.upload(files, {
model_type: 'App\\User',
model_id: 1,
onprogress: function(progress, uploaded, event) {
console.log({progress, uploaded, event});
},
onuploaded: function(result, error, file) {
console.log({result, error, file});
},
}).then(results => {
console.log(results);
});
});