PHP code example of pinpon / laravel-medialibrary-uploader
1. Go to this page and download the library: Download pinpon/laravel-medialibrary-uploader 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/ */
pinpon / laravel-medialibrary-uploader example snippets
use Pinpon\Uploader\MediaUploader
MediaUploader::upload(['image'])->to($model);
use Pinpon\Uploader\MediaUploader
$model = Model::first();
// Upload from one key
MediaUploader::upload('image')->to($model);
// Upload from multiple keys
MediaUploader::upload(['image', 'banner'])->to($model);
$model->getMedia('image');
$model->getMedia('banner');