mtbossa
mtbossa
FFilament
Created by giagara on 8/30/2023 in #❓┊help
File upload on s3 with Minio (sail)
Yes, this is definitely a solution. I don't like this approach of having to mess with hosts file... But I think that there aren't many solution for this, at least for now
9 replies
FFilament
Created by giagara on 8/30/2023 in #❓┊help
File upload on s3 with Minio (sail)
So, I managed to find a solution. I don't know if this is the best one, but it's working for now. In my docker-compose file I added the following:
minio:
image: 'minio/minio:latest'
ports:
- '${FORWARD_MINIO_PORT:-9000}:9000'
- '${FORWARD_MINIO_CONSOLE_PORT:-8900}:8900'
environment:
MINIO_ROOT_USER: 'sail'
MINIO_ROOT_PASSWORD: 'password'
volumes:
- 'sail-minio:/data/minio'
networks:
sail:
ipv4_address: 172.20.0.5
command: minio server /data/minio --console-address ":8900"
healthcheck:
test: [ "CMD", "curl", "-f", "http://localhost:9000/minio/health/live" ]
retries: 3
timeout: 5s
networks:
sail:
ipam:
config:
- subnet: 172.20.0.0/24
minio:
image: 'minio/minio:latest'
ports:
- '${FORWARD_MINIO_PORT:-9000}:9000'
- '${FORWARD_MINIO_CONSOLE_PORT:-8900}:8900'
environment:
MINIO_ROOT_USER: 'sail'
MINIO_ROOT_PASSWORD: 'password'
volumes:
- 'sail-minio:/data/minio'
networks:
sail:
ipv4_address: 172.20.0.5
command: minio server /data/minio --console-address ":8900"
healthcheck:
test: [ "CMD", "curl", "-f", "http://localhost:9000/minio/health/live" ]
retries: 3
timeout: 5s
networks:
sail:
ipam:
config:
- subnet: 172.20.0.0/24
MinIO always get the same IP address now. We can add now change AWS_ENDPOINT=http://minio:9000 to AWS_ENDPOINT=http://172.20.0.5:9000, and everything is going to work. The file will be uploaded in the browser, and the path will be properly saved in the database.
9 replies
FFilament
Created by giagara on 8/30/2023 in #❓┊help
File upload on s3 with Minio (sail)
I think this error happens because the host machine does not know how to resolve "http://minio:9000". However, Laravel container knows, that's why it works inside the application, but not in the browser when Filepond makes the request. I'm trying to find a solution for that
9 replies
FFilament
Created by Maagalhaes on 8/15/2023 in #❓┊help
TextInput does not add mask to field
Nice job!
22 replies
FFilament
Created by Maagalhaes on 8/15/2023 in #❓┊help
TextInput does not add mask to field
I was hoping someone would test/fix this
22 replies
FFilament
Created by Maagalhaes on 8/15/2023 in #❓┊help
TextInput does not add mask to field
I haven't, actually. I'm more focused on the features right now, but I'll probably need to get back to it, so I'll have to test this anyway. But I noticed the same that you did
22 replies
FFilament
Created by mtbossa on 8/25/2023 in #❓┊help
How to trigger a validation error from configureCreateAction() relation manager
Instead of making a Notification, I'd like to set some error message in the start_time and end_time fields
5 replies
FFilament
Created by mtbossa on 8/25/2023 in #❓┊help
How to trigger a validation error from configureCreateAction() relation manager
public function configureCreateAction(Tables\Actions\CreateAction $action) : void{
$action
->using(function (array $data, string $model, RelationManager $livewire) use ($action): Model|null {
$create_field_time_slot = App::make(CreateFieldTimeSlotAction::class);
try {
return $create_field_time_slot->handle(
field_id: $livewire->ownerRecord->id,
isoweekday: IsoWeekday::from($data['isoweekday']),
start_time: $data['start_time'],
end_time: $data['end_time'],
price: $data['price'],
reservation_discount: $data['reservation_discount'] ?? null,
);
} catch (TimeSlotOverlaps $exception) {
Notification::make()
->title(__('validation.overlaps'))
->body(__('validation.overlaps_start_end_time'))
->danger()
->send();

$action->halt();
}
});

parent::configureCreateAction($action);
}
public function configureCreateAction(Tables\Actions\CreateAction $action) : void{
$action
->using(function (array $data, string $model, RelationManager $livewire) use ($action): Model|null {
$create_field_time_slot = App::make(CreateFieldTimeSlotAction::class);
try {
return $create_field_time_slot->handle(
field_id: $livewire->ownerRecord->id,
isoweekday: IsoWeekday::from($data['isoweekday']),
start_time: $data['start_time'],
end_time: $data['end_time'],
price: $data['price'],
reservation_discount: $data['reservation_discount'] ?? null,
);
} catch (TimeSlotOverlaps $exception) {
Notification::make()
->title(__('validation.overlaps'))
->body(__('validation.overlaps_start_end_time'))
->danger()
->send();

$action->halt();
}
});

parent::configureCreateAction($action);
}
5 replies
FFilament
Created by Maagalhaes on 8/15/2023 in #❓┊help
TextInput does not add mask to field
Ok, I'll try it, after that I reply here. Thanks
22 replies
FFilament
Created by Maagalhaes on 8/15/2023 in #❓┊help
TextInput does not add mask to field
Then, I replied with a video, if you guys could check and see if I'm correct...
22 replies
FFilament
Created by Maagalhaes on 8/15/2023 in #❓┊help
TextInput does not add mask to field
Hey guys, so, I've noticed the same issue in Firefox. I've opened a issue in filament repo, however, I got the following reply: https://github.com/filamentphp/filament/issues/8047#issuecomment-1692379733
22 replies