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 particular style

The url method in Larupload is a convenient way to generate URLs for accessing uploaded files. You can use it to generate URLs for a specific style of an attachment or for the original file.

By default, if you don't pass any arguments to the url method, it returns the URL of the original style of the attachment. However, if you want to generate a URL for a specific style, you can pass the style name as an argument to the url method.

For example, let's say you have an attachment called avatar and you want to generate a URL for its thumb style. You can do this by calling the url method on the avatar attachment and passing the thumb style as an argument, like this:

$model->attachment('avatar')->url('thumb');

This will generate a URL that points to the thumb style of the avatar attachment.

And if you want to get the original file of the avatar attachment, you can generate it like this:

$model->attachment('avatar')->url();
# or
$model->attachment('avatar')->url('original');

PreviousGenerate Download LinkNextGenerate URL for all styles

Last updated 10 months ago