Skip to content

Latest commit

 

History

History
321 lines (257 loc) · 6.21 KB

events.md

File metadata and controls

321 lines (257 loc) · 6.21 KB

Events

BeforeInitialization

Alimardani94\LaravelFileManager\Events\BeforeInitialization

Example:

\Event::listen('Alimardani94\LaravelFileManager\Events\BeforeInitialization',
    function ($event) {
        
    }
);

DiskSelected

Alimardani94\LaravelFileManager\Events\DiskSelected

Example:

\Event::listen('Alimardani94\LaravelFileManager\Events\DiskSelected',
    function ($event) {
        \Log::info('DiskSelected:', [$event->disk()]);
    }
);

FilesUploading

Alimardani94\LaravelFileManager\Events\FilesUploading

\Event::listen('Alimardani94\LaravelFileManager\Events\FilesUploading',
    function ($event) {
        \Log::info('FilesUploading:', [
            $event->disk(),
            $event->path(),
            $event->files(),
            $event->overwrite(),
        ]);
    }
);

FilesUploaded

Alimardani94\LaravelFileManager\Events\FilesUploaded

\Event::listen('Alimardani94\LaravelFileManager\Events\FilesUploaded',
    function ($event) {
        \Log::info('FilesUploaded:', [
            $event->disk(),
            $event->path(),
            $event->files(),
            $event->overwrite(),
        ]);
    }
);

Deleting

Alimardani94\LaravelFileManager\Events\Deleting

\Event::listen('Alimardani94\LaravelFileManager\Events\Deleting',
    function ($event) {
        \Log::info('Deleting:', [
            $event->disk(),
            $event->items(),
        ]);
    }
);

Deleted

Alimardani94\LaravelFileManager\Events\Deleted

\Event::listen('Alimardani94\LaravelFileManager\Events\Deleted',
    function ($event) {
        \Log::info('Deleted:', [
            $event->disk(),
            $event->items(),
        ]);
    }
);

Paste

Alimardani94\LaravelFileManager\Events\Paste

\Event::listen('Alimardani94\LaravelFileManager\Events\Paste',
    function ($event) {
        \Log::info('Paste:', [
            $event->disk(),
            $event->path(),
            $event->clipboard(),
        ]);
    }
);

Rename

Alimardani94\LaravelFileManager\Events\Rename

\Event::listen('Alimardani94\LaravelFileManager\Events\Rename',
    function ($event) {
        \Log::info('Rename:', [
            $event->disk(),
            $event->newName(),
            $event->oldName(),
            $event->type(), // 'file' or 'dir'
        ]);
    }
);

Download

Alimardani94\LaravelFileManager\Events\Download

\Event::listen('Alimardani94\LaravelFileManager\Events\Download',
    function ($event) {
        \Log::info('Download:', [
            $event->disk(),
            $event->path(),
        ]);
    }
);

When using a text editor, the file you are editing is also downloaded! And this event is triggered!

DirectoryCreating

Alimardani94\LaravelFileManager\Events\DirectoryCreating

\Event::listen('Alimardani94\LaravelFileManager\Events\DirectoryCreating',
    function ($event) {
        \Log::info('DirectoryCreating:', [
            $event->disk(),
            $event->path(),
            $event->name(),
        ]);
    }
);

DirectoryCreated

Alimardani94\LaravelFileManager\Events\DirectoryCreated

\Event::listen('Alimardani94\LaravelFileManager\Events\DirectoryCreated',
    function ($event) {
        \Log::info('DirectoryCreated:', [
            $event->disk(),
            $event->path(),
            $event->name(),
        ]);
    }
);

FileCreating

Alimardani94\LaravelFileManager\Events\FileCreating

\Event::listen('Alimardani94\LaravelFileManager\Events\FileCreating',
    function ($event) {
        \Log::info('FileCreating:', [
            $event->disk(),
            $event->path(),
            $event->name(),
        ]);
    }
);

FileCreated

Alimardani94\LaravelFileManager\Events\FileCreated

\Event::listen('Alimardani94\LaravelFileManager\Events\FileCreated',
    function ($event) {
        \Log::info('FileCreated:', [
            $event->disk(),
            $event->path(),
            $event->name(),
        ]);
    }
);

FileUpdate

Alimardani94\LaravelFileManager\Events\FileUpdate

\Event::listen('Alimardani94\LaravelFileManager\Events\FileUpdate',
    function ($event) {
        \Log::info('FileUpdate:', [
            $event->disk(),
            $event->path(),
        ]);
    }
);

Zip

Alimardani94\LaravelFileManager\Events\Zip

\Event::listen('Alimardani94\LaravelFileManager\Events\Zip',
    function ($event) {
        \Log::info('Zip:', [
            $event->disk(),
            $event->path(),
            $event->name(),
            $event->elements(),
        ]);
    }
);

ZipCreated

Alimardani94\LaravelFileManager\Events\ZipCreated

\Event::listen('Alimardani94\LaravelFileManager\Events\ZipCreated',
    function ($event) {
        \Log::info('ZipCreated:', [
            $event->disk(),
            $event->path(),
            $event->name(),
            $event->elements(),
        ]);
    }
);

ZipFailed

Alimardani94\LaravelFileManager\Events\ZipCreated

\Event::listen('Alimardani94\LaravelFileManager\Events\ZipFailed',
    function ($event) {
        \Log::info('ZipFailed:', [
            $event->disk(),
            $event->path(),
            $event->name(),
            $event->elements(),
        ]);
    }
);

Unzip

Alimardani94\LaravelFileManager\Events\Unzip

\Event::listen('Alimardani94\LaravelFileManager\Events\Unzip',
    function ($event) {
        \Log::info('Unzip:', [
            $event->disk(),
            $event->path(),
            $event->folder(),
        ]);
    }
);

UnzipCreated

Alimardani94\LaravelFileManager\Events\UnzipCreated

\Event::listen('Alimardani94\LaravelFileManager\Events\UnzipCreated',
    function ($event) {
        \Log::info('UnzipCreated:', [
            $event->disk(),
            $event->path(),
            $event->folder(),
        ]);
    }
);

UnzipFailed

Alimardani94\LaravelFileManager\Events\UnzipFailed

\Event::listen('Alimardani94\LaravelFileManager\Events\UnzipFailed',
    function ($event) {
        \Log::info('UnzipFailed:', [
            $event->disk(),
            $event->path(),
            $event->folder(),
        ]);
    }
);