PHP code example of yesteamtech / laravel-file-manager

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

    

yesteamtech / laravel-file-manager example snippets


    protected $listen = [
        ImageWasUploaded::class => [
            UploadListener::class,
        ],
    ];

class UploadListener
{
    public function handle($event)
    {
        $method = 'on'.class_basename($event);
        if (method_exists($this, $method)) {
            call_user_func([$this, $method], $event);
        }
    }

    public function onImageWasUploaded(ImageWasUploaded $event)
    {
        $path = $event->path();
        //your code, for example resizing and cropping
    }
}