giagara
giagara
FFilament
Created by giagara on 5/17/2024 in #❓┊help
Error while testing with phpunit starting from v3.2.77
With this simple test:
$file_name = 'document.pdf';
$file = UploadedFile::fake()->create($file_name, 100);

Livewire::test(CreateDocument::class)
->fillForm([
'permissions' => $document->permissions,
'name' => $file,
'language' => $document->language,
])
->call('create')
$file_name = 'document.pdf';
$file = UploadedFile::fake()->create($file_name, 100);

Livewire::test(CreateDocument::class)
->fillForm([
'permissions' => $document->permissions,
'name' => $file,
'language' => $document->language,
])
->call('create')
i get the error ErrorException: Trying to access array offset on value of type null This error starts happening since v3.2.77. With v3.2.76 the test executes correctly. Other tests with same syntax are executing correctly
1 replies
FFilament
Created by giagara on 8/30/2023 in #❓┊help
File upload on s3 with Minio (sail)
Hi, I've alredy read the other posts about this topic but i can't get it working. The scenario: A category resource where i want to upload a picture that should be public (think about a sort of eccomerce). In the resource (form) i have
Forms\Components\FileUpload::make('picture')
->disk('s3')
->directory('categories')
Forms\Components\FileUpload::make('picture')
->disk('s3')
->directory('categories')
in .env:
AWS_ACCESS_KEY_ID=something
AWS_SECRET_ACCESS_KEY=something
AWS_DEFAULT_REGION=us-east-1
AWS_BUCKET=mybucketname
AWS_USE_PATH_STYLE_ENDPOINT=true
AWS_ENDPOINT=http://minio:9000
AWS_URL=http://localhost:9000/local
AWS_ACCESS_KEY_ID=something
AWS_SECRET_ACCESS_KEY=something
AWS_DEFAULT_REGION=us-east-1
AWS_BUCKET=mybucketname
AWS_USE_PATH_STYLE_ENDPOINT=true
AWS_ENDPOINT=http://minio:9000
AWS_URL=http://localhost:9000/local
Using something like Storage::disk('s3')->put('categories/asd.txt','asd');works like a charm, but when i do it from web interface it gives me an error. What seems strange is that filament tries to upload directly the picture to minio: livewire.js?id=11c49d7e:3953 PUT http://minio:9000/mybucketname/livewire-tmp/jiuIgVyZYQO9hFAyFvZT9bvf5q3zrx-metaYjMuanBn-.jpg?x-amz-acl=private&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=4VfWaDjtRdnIjFh1osj9%2F20230830%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20230830T081610Z&X-Amz-SignedHeaders=host%3Bx-amz-acl&X-Amz-Expires=300&X-Amz-Signature=0bac68f62bcceb8eeeab1ca27fe157095c927aa2df4924f8bb8f3e104f7f5c3a net::ERR_NAME_NOT_RESOLVED am i missing something? thanks
9 replies