1. Go to this page and download the library: Download sudippalash/media-input 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/ */
sudippalash / media-input example snippets
return [
/*
|--------------------------------------------------------------------------
| Platform
|--------------------------------------------------------------------------
|
| Which platform you use in your application. Example: bootstrap3 or bootstrap4 or bootstrap5 or default
| Note: you should add bootstrap platform CSS and JS library. If you use default then no need to add bootstrap CSS and JS library
|
*/
'platform' => 'bootstrap3',
/*
|--------------------------------------------------------------------------
| From URL
|--------------------------------------------------------------------------
|
| If you want to upload image from url & embed youtube video url
|
*/
'image_from_url' => true,
'video_from_url' => true,
/*
|--------------------------------------------------------------------------
| Styles Default Stack
|--------------------------------------------------------------------------
|
| Styles to push in appropriate stack (
<x-media-input::image
uniqueId="{provide unique id if you use multiple in single page}"
name="{file input name}"
:fileUrls="['array of file url (optional)']"
/>
<x-media-input::image
uniqueId="{provide unique id if you use multiple in single page}"
name="{file input name}"
itemKey="id"
itemValue="image_url"
:items="[collection of object (optional)]"
/>