Zooniverse uses Laravel’s soft-delete mechanism for animals, which means that deleting an animal does not permanently erase its record from the database. Instead, the record is stamped with aDocumentation 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.
deleted_at timestamp and hidden from normal queries. Archived animals can be reviewed at any time and restored to a compatible enclosure, making this a safe and reversible operation.
What Soft-Delete Means
TheAnimal model uses the SoftDeletes trait:
animals table has a deleted_at column added by the migration:
- Its
deleted_atcolumn is set to the current timestamp. - Its
enclosure_idis set tonull, removing it from its enclosure. - All standard Eloquent queries (e.g.,
Animal::all()) automatically exclude soft-deleted records. - The row remains in the
animalstable and can be retrieved withAnimal::onlyTrashed().
Archiving an animal frees its slot in the enclosure immediately. The enclosure’s animal count decreases, which may allow new animals to be added even if the enclosure was previously full.
How to Archive an Animal
An admin deletes an animal from the enclosure detail view. The controller setsenclosure_id to null before soft-deleting, so the animal is cleanly disassociated from its enclosure:
Click the delete button
Locate the animal in the list and click its delete button. No confirmation dialog is shown — the action is immediate.
Viewing Archived Animals
Navigate to/animals/archived to see a table of all soft-deleted animals. The controller retrieves them using onlyTrashed() and sorts by deleted_at descending so the most recently archived animals appear first:
| Column | Description |
|---|---|
| Animal Name | The animal’s name |
| Species | The animal’s species |
| Archived At | The deleted_at timestamp |
| Actions | A Restore button for each animal |
How to Restore an Animal
Each row in the archived animals table has a Restore button that opens a modal dialog. The modal shows the animal’s name and species, and presents a dropdown of valid enclosures — only enclosures that are both type-compatible and not full are listed.Go to the archived animals page
Navigate to
/animals/archived. All soft-deleted animals are listed here in order of most recently archived.Click Restore
Click the Restore button on the row of the animal you want to restore. A modal opens showing the animal’s details and a dropdown of valid enclosures.
Select a target enclosure
Choose an enclosure from the dropdown. Only enclosures that pass both compatibility and capacity checks are shown.
Validation on Restore
Two checks are enforced before an animal can be restored: Type compatibility — The animal’sis_predator flag must match the enclosure’s existing animal type. An enclosure with no animals accepts either type.