PHP code example of mrmadclown / laravel-multipart-response

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

    

mrmadclown / laravel-multipart-response example snippets


MrMadClown\LaravelMultiPartResponse\ServiceProvider::class,

use MrMadClown\LaravelMultipartResponse\Http\MultipartResponse;

$elements = [[
    'name' => 'my-file',
    'contents' => fopen('my-file.txt', 'rb'),
    'filename' => 'my-file.txt'
]];

return new MultipartResponse($elements);

use MrMadClown\LaravelMultipartResponse\Http\MultipartResponse;

return MultipartResponse::fromDirectory('/var/www/html/storage/app/files-to-send');

$elements = [[
    'name' => 'my-file',
    'contents' => fopen('my-file.txt', 'rb'),
    'filename' => 'my-file.txt'
]];

return \response()->multipart($elements);