.ddddddddddddddddddddddddddddddd
.ddddddddddddddddddddddddddddddd
FFilament
Created by .ddddddddddddddddddddddddddddddd on 8/4/2023 in #❓┊help
Database Notifications not popup
4 replies
FFilament
Created by .ddddddddddddddddddddddddddddddd on 6/12/2023 in #❓┊help
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.
public static function form(Form $form): Form
{
$uuid = (string) Str::uuid();

Log::debug('form');
Log::debug($uuid);

return $form
->schema([
Forms\Components\Hidden::make('uuid')
->default($uuid)
->visibleOn('create'),

Forms\Components\FileUpload::make('video')
->directory("contents/{$uuid}"),
]);
}
public static function form(Form $form): Form
{
$uuid = (string) Str::uuid();

Log::debug('form');
Log::debug($uuid);

return $form
->schema([
Forms\Components\Hidden::make('uuid')
->default($uuid)
->visibleOn('create'),

Forms\Components\FileUpload::make('video')
->directory("contents/{$uuid}"),
]);
}
[2023-06-12 14:06:45] local.DEBUG: form
[2023-06-12 14:06:45] local.DEBUG: 6078e6d2-74b9-4356-baec-c7fdc0dfcd24
[2023-06-12 14:06:45] local.DEBUG: form
[2023-06-12 14:06:45] local.DEBUG: 6abe8fb4-fef8-4f86-8b6c-2f938201e983
[2023-06-12 14:06:45] local.DEBUG: form
[2023-06-12 14:06:45] local.DEBUG: 6078e6d2-74b9-4356-baec-c7fdc0dfcd24
[2023-06-12 14:06:45] local.DEBUG: form
[2023-06-12 14:06:45] local.DEBUG: 6abe8fb4-fef8-4f86-8b6c-2f938201e983
6 replies