PHP code example of cybex / laravel-lodor

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

    

cybex / laravel-lodor example snippets

 php
Route::post('/uploaded')->uses('SomeController@uploaded')->name('lodor_uploaded');
 php


namespace App\Http\Controllers;

use Illuminate\Http\Request;
use App\Http\Controllers\Controller;

class SomeController extends Controller 
{
   function uploaded(Request $request, bool $success, string $uuid, array $metadata, string $errorMessage = null) {
        // Do something here and handle the request returning some response, view or redirect.
    }
}
bash
php artisan vendor:publish --provider="Cybex\Lodor\LodorServiceProvider" --tag=config
 php
use App\Listeners\FileUploadedListener;
use Cybex\Lodor\Events\FileUploaded;

class EventServiceProvider extends ServiceProvider
{
    /**
     * The event listener mappings for the application.
     *
     * @var array
     */
    protected $listen = [
        FileUploaded::class => [
            FileUploadedListener::class,
        ],
    ];
 php
Lodor::cleanupUpload($event->uuid, true);