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. Queue FFMpeg Processes

Job Completion Event

Larupload provides an event that fires when an FFMpeg job finishes processing in the queue. This event can be used to perform additional actions once the job is complete, such as sending a notification to a user or updating a database record. The event can be listened to using Laravel's built-in event system, and it provides access to the attachment model and the original request.

To utilize this feature, you need to create an event listener and register it. Once the job is completed, Larupload will notify your listener and provide the necessary information.

  1. Create Listener

php artisan make:listener LaruploadFFMpegQueueNotification
  1. Register Listener

App\Providers\EventServiceProvider
use App\Events\OrderShipped;
use Mostafaznv\Larupload\Events\LaruploadFFMpegQueueFinished;
use App\Listeners\LaruploadFFMpegQueueNotification;
 

protected $listen = [
    LaruploadFFMpegQueueFinished::class => [
        LaruploadFFMpegQueueNotification::class,
    ],
];
  1. Fetch Notification

<?php

namespace App\Listeners;

class LaruploadFFMpegQueueNotification
{
    public function handle(LaruploadFFMpegQueueFinished $event)
    {
        info("larupload queue finished. id: $event->id, model: $event->model, statusId: $event->statusId");
    }
}
PreviousQueue FFMpeg ProcessesNextFFMpeg Queue Relationships

Last updated 2 years ago