Using ApyHub for Image Moderation
In Auctibles, we use ApyHub to moderate images of items for auction. Auctibles is built using the Laravel PHP framework.
Uploading Image Files
Videos are effortlessly uploaded using a straightforward Livewire component and an HTML input
element with type=file
.
<input id="photos" name="photos" type="file" class="sr-only" wire:model.live="photos" accept="image/png,image/jpg,image/gif">
The component has a public property:
public $photos = [];
Upon clicking a submit
button, we apply validation to the field,
'photos' => 'nullable|array|max:3', // array
'photos.*' => [
'required',
'image',
'max:10240', // 10MB
new ExplicitImage(),
],
ExplicitImage
is a validation rule.
Temporary Files
We upload temporary files to a Minio bucket which resides on the server. The bucket is defined as an uploads
bucket for Laravel. This is done in config/filesystems.php
.
ApyHub Results for Image Content
We use curl
to call ApyHub. The response looks like this:
{
"data": {
"apyhub": {
"adult": {
"adultScore"…