PHP code example of sudippalash / media-input

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)]"
/>

<script src="https://code.jquery.com/jquery-3.6.3.min.js"></script>

<script src="https://cdn.jsdelivr.net/gh/sudippalash/media-input/assets/js/Sortable.min.js"></script>

<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/sudippalash/media-input/assets/css/magnific-popup.css">
<script src="https://cdn.jsdelivr.net/gh/sudippalash/media-input/assets/js/jquery.magnific-popup.min.js"></script>
bash
php artisan vendor:publish --provider="Sudip\MediaInput\Providers\AppServiceProvider" --tag=config
bash
php artisan vendor:publish --provider="Sudip\MediaInput\Providers\AppServiceProvider" --tag=lang
bash
php artisan vendor:publish --provider="Sudip\MediaInput\Providers\AppServiceProvider" --tag=views