# Get Attachments

The `getAttachments` function allows you to retrieve all URLs and meta information for the attachments assigned to a model. If no argument is provided, it returns URLs and meta for all attachments. However, you can pass the attachment name as an argument to retrieve the data for a specific attachment.

{% tabs %}
{% tab title="Get All Attachments" %}

```php
$user = User::query()->first();
$attachments = $user->getAttachments();
```

{% code title="Output" %}

```json
{
  "avatar": {
    "original": "https://larupload.dev/storage/users/1/avatar/original/image.jpg",
    "thumbnail": "https://larupload.dev/storage/users/1/avatar/thumbnail/image.jpg",
    "cover": "https://larupload.dev/storage/users/1/avatar/cover/image.jpg",
    "meta": {
       "name": "image.jpg",
       "id": "1",
       "original_name": "image.jpg"
       "size": 35700,
       "type": "IMAGE",
       "mime_type": "image/jpeg",
       "width": 1077,
       "height": 791,
       "duration": null,
       "dominant_color": "#f4c00a",
       "format": "jpg",
       "cover": "image.jpg"
    }
  },
  "cv": {
    "original": "https://larupload.dev/storage/users/1/cv/original/cv.pdf",
    "cover": "https://larupload.dev/storage/users/1/cv/cover/cv.jpg",
    "meta": {
       "name": "cv.pdf",
       "id": "1",
       "original_name": "image.jpg"
       "size": 71710,
       "type": "DOCUMENT",
       "mime_type": "application/pdf",
       "width": null,
       "height": null,
       "duration": null,
       "dominant_color": "#f4c00a",
       "format": "pdf",
       "cover": "cv.jpg"
    }
  }
}
```

{% endcode %}
{% endtab %}

{% tab title="Get Particular Attachment" %}

```php
$user = User::query()->first();
$attachment = $user->getAttachments('avatar');
```

{% code title="Output" %}

```json
{
   "original": "https://larupload.dev/storage/users/1/avatar/original/image.jpg",
   "thumbnail": "https://larupload.dev/storage/users/1/avatar/thumbnail/image.jpg",
   "cover": "https://larupload.dev/storage/users/1/avatar/cover/image.jpg",
   "meta": {
       "name": "image.jpg",
       "id": "1",
       "original_name": "image.jpg"
       "size": 35700,
       "type": "IMAGE",
       "mime_type": "image/jpeg",
       "width": 1077,
       "height": 791,
       "duration": null,
       "dominant_color": "#f4c00a",
       "format": "jpg",
       "cover": "image.jpg"
    }
 }
```

{% endcode %}
{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://mostafaznv.gitbook.io/larupload/get-attachments.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
