PHP code example of gigcodes / asset-manager

1. Go to this page and download the library: Download gigcodes/asset-manager 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/ */

    

gigcodes / asset-manager example snippets


$media = MediaUploader::fromSource($request->file('thumb'))
	->toDestination('uploads', 'blog/thumbnails')
	->upload();

$post = Post::create($this->request->input());
$post->attachMedia($media, ['thumbnail']);

$post->getMedia('thumbnail')->first()->getUrl();
bash
php artisan vendor:publish --provider="Gigcodes\AssetManager\AssetManagerServiceProvider" 
bash
php artisan migrate