Larupload
  • 🏁Getting Started
    • Introduction
    • Installation
    • Laravel Nova integration
    • Support Us
    • License
  • 🚀Basic Usage
    • Database Preparation
    • Model Preparation
    • Upload
  • ⚙️Advanced Usage
    • Concepts
    • Configuration
      • Disk
      • Local Disk
      • Mode
      • SecureIds
      • With Meta
      • Camel Case Response
      • Hide Table Columns
      • Naming Method
      • Lang
      • Image Processing Library
      • Generate Cover
      • Cover Style
      • Dominant Color
      • Dominant Color Quality
      • Keep Old Files
      • Preserve Files
      • Store Original File Name
      • Optimize Image
      • FFMpeg
        • FFMpeg Binaries
        • FFMpeg Threads
        • FFMpeg Capture Frame
        • FFMpeg Queue
        • FFMpeg Max Queue Number
        • FFMpeg Timeout
        • FFMPEG Log Channel
    • Attachment
      • Disk
      • With Meta
      • Naming Method
      • Lang
      • Image Processing Library
      • Generate Cover
      • Cover Style
      • Dominant Color
      • Dominant Color Quality
      • Keep Old Files
      • Preserve Files
      • Store Original File Name
      • SecureIds Method
      • Optimize Image
      • Media Styles
      • Complete Example
    • Migrations
      • Heavy Columns
      • Light Columns
      • Add Original File Name to Existing Tables
  • Upload
  • Delete
  • Cover
    • Upload Cover
    • Update Cover
    • Delete Cover
  • Download
    • Generate Download Link
      • Generate URL for particular style
      • Generate URL for all styles
    • Generate Download Response
  • Meta
  • Get Attachments
  • API Resources
  • Image Optimization
  • SecureIds
  • Queue FFMpeg Processes
    • Job Completion Event
    • FFMpeg Queue Relationships
  • 🧱Standalone Uploader
    • Introduction
    • Upload
    • Delete
    • Cover
      • Update Cover
      • Delete Cover
    • Customization
  • ⚪OTHER
    • Migration
Powered by GitBook
On this page
Edit on GitHub
  1. Download
  2. Generate Download Link

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:

$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:

Output
{
    "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"
}

PreviousGenerate URL for particular styleNextGenerate Download Response

Last updated 10 months ago