robbiepaul / cloudconvert-laravel

A Laravel wrapper for the CloudConvert API
177 stars 34 forks source link

accessing the process id #26

Closed chrisbell08 closed 8 years ago

chrisbell08 commented 8 years ago

Hey,

I need to access the process ID when I make a request so I can save it to a DB and do some stuff with it when the callback comes back from cloud convert. The only way I can do this is by changing the $process property on the cloud convert class to public then doing this:

    $cloudconvert =  CloudConvert::file($url)->withOptions([
            'thumbnail_count' => '1',
            'thumbnail_size' => '203x113',
            'thumbnail_format' => 'png'
        ])->callback(env('SITE_URL') . '/events/videoConverted')->convert('webm');

        $processId = $cloudconvert->process->id;

The only issue with this is that i've had to override something in your core library which isn't ideal as I would then have to prevent it from updating.

Is there currently a better way to access the ID? If not would it be possible to add this in?

robbiepaul commented 8 years ago

This should work:

$processId = $cloudconvert->getProcess()->id;
chrisbell08 commented 8 years ago

Works a treat thanks!

robbiepaul commented 8 years ago

Glad to help!