PHP code example of triasrahman / media-upload

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

    

triasrahman / media-upload example snippets


/*
 |--------------------------------------------------------------------------
 | Upload Types
 |--------------------------------------------------------------------------
 |
 | It's the flexibility of this package. You can define the type of upload
 | file methods. For example, you want to upload for profile picture,
 | article post, background, etc. Here is 
 |
 */

'types' => [
	// ... put your custom type ...

	'profile' => [
		'middleware' => 'auth',
		'format' => 'image',
		'image' => [
			'fit' => [400, 400],
			'thumbs' => [
				'small' => [50, 50],
				'medium' => [100, 100],
			]
		],
		'save_original' => true,
	],

	'profile-cover' => [
		'middleware' => 'auth',
		'format' => 'image',
		'image' => [
			'fit' => [1200, 400],
		],
		'multiple' => false,
	],

	'media' => [
		'middleware' => 'auth',
		'format' => 'image|video|audio',
		'image' => [
			'thumbs' => [
				'small' => [50, 50],
				'medium' => [100, 100],
			]
		],
		'multiple' => true,
	],

],   


'providers' => [
	//	...
	'Triasrahman\MediaUpload\MediaUploadServiceProvider',
]

php artisan vendor:publish