PHP code example of stechstudio / laravel-upload-server

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

    

stechstudio / laravel-upload-server example snippets


UploadServer::route();

Route::prefix('app')->group(function () {
    UploadServer::route()->withoutMiddleware('csrf');
});

public function handleFormSubmission(Request $request)
{
    // 'attachments' is the name of the client-side uploader
    $files = UploadServer::retrieve($request->input('attachments'));
}

$files = UploadServer::retrieve($request->input('attachments'));

foreach($files AS $file) {
    $file->store('attachments', 's3');
}