# Generate URL for all styles

Generating URLs for all styles of an attachment can be done using the `urls` method provided by the Larupload. This method returns an `object` of URLs for all available styles of the attachment.

The `urls` method can be called on an attachment instance, which can be retrieved from a model instance using the `attachment` method. For example, if you have a `User` model with an `avatar` attachment, you can generate URLs for all styles of the `avatar` attachment using the following code:

```php
$user->attachment('avatar')->urls();
```

The returned object contains URLs for all styles of the attachment, including the original file. By default, the properties of the object are the style names, and the values are the corresponding URLs. For example:

{% 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"
}
```

{% endcode %}

<br>


---

# 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/download/generate-download-link/generate-url-for-all-styles.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.
