PHP code example of ervinsvilumsons / laravel-upload

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

    

ervinsvilumsons / laravel-upload example snippets


use UploadManager;

$result = UploadManager::profile('documents')->upload($request->file('document'));

return [
    'default' => [
        'disk' => 'local',
        'path' => 'uploads/{year}/{month}/{day}',
        'filename' => 'uuid',
        'hash' => false,
        'encrypt' => false,
    ],

    'profiles' => [
        'documents' => [
            'path' => 'documents',
            'filename' => 'sha256',
            'hash' => true,
        ],

        'secure' => [
            'disk' => 's3',
            'path' => 'secure',
            'filename' => 'sha256',
            'encrypt' => true,
        ],
    ],
];

$result->path;
$result->url;
$result->size;
$result->contentHash;
$result->name;
$result->originalName;
$result->extension;
$result->mimeType;
bash
php artisan vendor:publish --tag=upload-manager