How can I upload file with UUID directory
I want the uuid field is same with the upload directory,
but after I see the log,
the debug log will print twice after I added FileUpload,
and generate the UUID again,
this make the UUID in upload directory is different to uuid field.
Solution:Jump to solution
Found a solution.
I don't know if it is the best way, but at least it can accomplish my purpose, write it down in case anyone also needs this.
```php
public static function form(Form $form): Form...
4 Replies
Use memoization. The form method it called multiple times leading to multiple UUIDS
I tried spatie/once, but the UUIDs are still different.
Hm, weird. I don't know, sorry.
Solution
Found a solution.
I don't know if it is the best way, but at least it can accomplish my purpose, write it down in case anyone also needs this.