Animals are the individual creatures housed within enclosures in Zooniverse. Each animal belongs to exactly one enclosure at a time, carries a type (predator or herbivore) that must match the other animals in that enclosure, and can optionally have a photo. Admins manage the full animal lifecycle; archived (soft-deleted) animals are retained in the database and can be restored to a compatible enclosure at any time.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/raczkodavid/Zooniverse/llms.txt
Use this file to discover all available pages before exploring further.
Animal fields
Theanimals table stores the following columns:
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | The animal’s individual name. |
species | string | Yes | The species (e.g. "Lion", "Zebra"). |
is_predator | boolean | Yes | true for predators, false for herbivores. |
born_at | timestamp | Yes | The animal’s date and time of birth. |
image_name | string | No | Original filename of the uploaded image. |
image_name_hash | string | No | Hashed filename used for storage on disk. |
enclosure_id | unsignedBigInteger | No | Foreign key to the assigned enclosure. Set to null when archived. |
deleted_at | timestamp | No | Populated on soft-delete (archive). null for active animals. |
Adding an animal
Only admins can create animals. Navigate toGET /animals/create or use the Add Animal action.
Fill in the animal details
Complete the form with the following fields:
- Name — the animal’s individual name (required string).
- Species — the species name (required string).
- Animal type — choose
PredatororHerbivorefrom the dropdown (required). - Born At — select a datetime using the datetime-local picker (required).
- Image — upload an optional photo (any image file type via
accept="image/*").
Select an enclosure
Click Select Enclosure to open the enclosure picker modal. The dropdown colour-codes available enclosures:
- Green — empty enclosure (accepts either type).
- Red — predator enclosure.
- No highlight — herbivore enclosure.
Validation rules
The
born_at field must be a valid date that is before the current date and time and after 1 January 1900. Future dates and dates before 1900 are rejected.Compatibility and capacity checks
After field validation the server performs two additional checks before saving.Type compatibility
The selected enclosure must be compatible with the animal’s type:Capacity check
The enclosure must not already be full:Image upload
The image field is optional. When a file is provided:- The original filename is saved to
image_name. - A hashed filename is generated (
$image->hashName()) and saved toimage_name_hash. - The file is stored in the
publicdisk under theimages/directory:
storage/images/{image_name_hash}. If no image is uploaded, a placeholder image is displayed in the enclosure detail view.
Editing an animal
Only admins can edit animals. Navigate toGET /animals/{id}/edit or click Edit on an animal in the enclosure detail view.
The edit form is identical to the create form and applies the same validation rules and compatibility/capacity checks.
When editing, the capacity check runs against the target enclosure, not the animal’s current enclosure. If the animal is staying in its current enclosure and that enclosure is full, the edit will be rejected unless you are not changing the enclosure. Plan moves accordingly.
Image replacement
If a new image is uploaded during an edit:- The old image is deleted from storage:
- The new file is stored with a freshly generated hash, and both
image_nameandimage_name_hashare updated on the record.
Archiving (soft-delete) an animal
Click Archive on an animal in the enclosure detail view. This sends aDELETE /animals/{id} request.
Archiving does not permanently remove the animal. The controller:
- Sets
enclosure_idtonull, removing the animal from its enclosure. - Calls
$animal->delete(), which triggers Laravel’sSoftDeletestrait and populatesdeleted_at.
Restoring an archived animal
Admins can view all archived animals atGET /animals/archived. The list is ordered by deleted_at descending (most recently archived first).
To restore an animal:
Select a target enclosure
Choose a compatible, non-full enclosure from the restore form for that animal.