PHP code example of jensramakers / laravel-media-library

1. Go to this page and download the library: Download jensramakers/laravel-media-library 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/ */

    

jensramakers / laravel-media-library example snippets


<button data-modal-open="laptop-modal" role="button" class="btn-primary mb-3">{{ __('admin.open_gallery') }}</button>
<x-input-file-selector :files="$laptop->files" gallery-id="laptop-create-gallery" container-element-id="laptop-form-images" input-name="laptop_images" form="laptop-form" modal-name="laptop-modal" />

 @livewire('media-library')

$laptop->files()->sync($this->getFilesInOrder($request->laptop_images));

$laptop->files();
$laptop->images();
bash
php artisan vendor:publish --tag=laravel-media-library
php artisan migrate