Open geertjanknapen1 opened 3 months ago
Update to clarify.
With " I DO NOT want to cancel uploading of the asset, instead, I want to show a Toast notification to the user, giving them some info that the entry was not automatically created." I mean I still want the X Asset uploaded
toast, but another custom toast with information.
Not what is shown below. I know this does not cancel uploading of assets, but it definitely looks like it for the end-user.
Bug description
The documentation states I should be able to fire Toast notifications from the server using the Toast facade.
Based on when an asset is uploaded, I want to create an entry in a specific collection. This entry should have a "sanitized" version of the asset title. So I listen to the AssetUploaded event, and if it is fired for a specific asset container I get to work creating an entry.
However, we will not be listening for AssetDeleted events, so in my event listener, I check if an entry with that specific "sanitized" name already exists. If that happens, I DO NOT want to cancel uploading of the asset, instead, I want to show a Toast notification to the user, giving them some info that the entry was not automatically created.
So I followed the documentation and utilized the code below to show a Toast notification. However, except for the
X Asset uploaded
toast, nothing displays.So my questions are:
AssetCreated
orAssetSaved
or something?I'll post the full handle method of the listener below.
How to reproduce
Minimal steps would be as follows:
AssetUploaded
event.Code for it could look as follows:
Logs
No response
Environment
Installation
Existing Laravel app
Additional details
No response