Events¶
This package dispatches Laravel events for mutating WebDAV node operations.
Use these events when application code should react to WebDAV-side filesystem changes without replacing the package nodes.
Event Namespace¶
All WebDAV node events live under:
N3XT0R\LaravelWebdavServer\Events\WebDav
Concrete event classes:
DirectoryCreatedEventDirectoryDeletedEventFileCreatedEventFileUpdatedEventFileDeletedEvent
Common Event Data¶
All WebDAV node events extend NodeEvent.
Every event provides:
string $disk- the Laravel filesystem disk used for the operationstring $path- the resolved storage path on that diskWebDavPrincipalValueObject $principal- the authenticated WebDAV principal for the request
File events extend FileEvent and additionally provide:
int $bytes- the number of bytes written for the file operation
Dispatch Timing¶
The package dispatches these events only after the underlying filesystem mutation succeeds.
If authorization fails, stream reading fails, or the filesystem operation throws before completion, the event is not dispatched.
DirectoryCreatedEvent¶
Purpose:
- indicates that a WebDAV directory was created
Dispatched when:
AbstractStorageCollection::createDirectory()successfully creates a child directory through the resolved Laravel filesystem
Typical WebDAV operation:
MKCOL
Event data:
diskpathprincipal
DirectoryDeletedEvent¶
Purpose:
- indicates that a WebDAV directory was deleted
Dispatched when:
StorageDirectory::delete()successfully removes the target directory after recursively deleting nested files and directories
Typical WebDAV operation:
DELETEfor a directory node
Event data:
diskpathprincipal
FileCreatedEvent¶
Purpose:
- indicates that a new WebDAV file was created
Dispatched when:
AbstractStorageCollection::createFile()successfully writes a new child file- the event is dispatched for string payloads, stream payloads, and
nullpayloads that become an empty file
Typical WebDAV operation:
PUTfor a new file
Event data:
diskpathprincipalbytes
FileUpdatedEvent¶
Purpose:
- indicates that an existing WebDAV file was overwritten
Dispatched when:
StorageFile::put()successfully overwrites the current file- the event is dispatched for both string payloads and stream payloads
Typical WebDAV operation:
PUTfor an existing file
Event data:
diskpathprincipalbytes
FileDeletedEvent¶
Purpose:
- indicates that a WebDAV file was deleted
Dispatched when:
StorageFile::delete()successfully deletes the current file
Typical WebDAV operation:
DELETEfor a file node
Event data:
diskpathprincipal
Notes¶
- These events are Laravel events. Applications can listen to them with normal Laravel event listeners, subscribers, or queued listeners.
- The package does not register any listeners for these events.
- The events describe WebDAV-triggered node mutations inside the package runtime. They are not general filesystem events for all Laravel storage writes.