This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function saved(Task $task): void | |
{ | |
if ($task->isDirty('attachment')) { | |
$originalFieldContents = $task->getOriginal('attachment'); | |
$newFieldContents = $task->attachment; | |
# We attempt to JSON decode the field. If it is an array, this is an indication we have ->multiple() activated | |
$originalFieldContentsDecoded = json_decode($task->getOriginal('attachment')); |