PHP code example of solid3d / laravel-tus-s3

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

    

solid3d / laravel-tus-s3 example snippets


use Solid3d\LaravelTusS3\Events\FileUploadFinished;

public function handle(FileUploadFinished $event): void
{
    $fingerprint = $event->tusFile->fingerprint(maximumBytes: 1_073_741_824);

    $event->tusFile->moveTo(
        disk: 's3',
        path: "library/{$fingerprint->sha256}.bin",
    );
}

use Illuminate\Support\Facades\Schedule;

Schedule::command('tus:prune')->hourly();
Schedule::command('tus:dispatch-finished')->everyMinute();
bash
php artisan migrate
bash
php artisan vendor:publish --tag=tus-config