> For the complete documentation index, see [llms.txt](https://mostafaznv.gitbook.io/larupload/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://mostafaznv.gitbook.io/larupload/api-resources.md).

# API Resources

Larupload automatically includes all attachments in JSON responses, but if you want to retrieve the attachments manually, you can use the built-in `toArray()` and `toJson()` methods, which will return an array or JSON representation of the model, including all attachments.

```php
$upload = Upload::query()->first();

$upload->toArray();
$upload->toJson();
```
