public function creating(File $file) { if (is_null($file->getAttribute('id'))) { $file->id = Uuid::uuid4()->toString(); } }