PHP code example of emaia / laravel-mediaman

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

    

emaia / laravel-mediaman example snippets


$media = MediaUploader::fromRequest('featured_image')
    ->useCollection('Posts')
    ->upload();

$post = Post::find(1);
$post->attachMedia($media, 'featured-image-channel');
bash
composer mediaman:publish
php artisan storage:link
php artisan migrate
php artisan mediaman:doctor