# With Meta

The `withMeta` method allows you to include metadata associated with uploaded files in the response of the `urls` method. When this method is enabled for an attachment instance, metadata such as the format of the file, its dimensions, dominant color, and other relevant information will be included in the response along with the URLs.

To enable `withMeta` for an attachment, simply call the method on the attachment instance, like so:

```php
<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Mostafaznv\Larupload\Storage\Attachment;
use Mostafaznv\Larupload\Traits\Larupload;

class Media extends Model
{
    use Larupload;

    public function attachments(): array
    {
        return [
            Attachment::make('file')->withMeta(true)
        ];
    }
}
```

This will enable metadata to be included in the response when the `urls` method is called on this attachment instance.


---

# 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/advanced-usage/attachment/with-meta.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.
