PHP code example of manulith / sketchfab-php

1. Go to this page and download the library: Download manulith/sketchfab-php library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

manulith / sketchfab-php example snippets



$file = '/path/to/file.stl';
$response = Sketchfab::upload($file);
echo $response['uid'];


$file = '/path/to/file.stl';
$options = array(
    'name'        => 'My awesome object',
    'description' => 'This is just a test file.',
    'tags'        => 'awesome fun',
    'private'     => true,
    'password'    => 'letmein',
);
$response = Sketchfab::upload($file, $options);
echo $response['uid'];


$response = Sketchfab::status('cnTC9viItfZ1fdT811NgEVafw1S');
echo $response['processing'];


$response = Sketchfab::info('cnTC9viItfZ1fdT811NgEVafw1S');
print_r($response);


echo Sketchfab::embed('cnTC9viItfZ1fdT811NgEVafw1S');


$options = array(
    'width'       => 320, // or '100%'
    'height'      => 280,
    'ui_infos'    => 1,
    'ui_controls' => 1,
    'ui_stop'     => 1,
    'autostart'   => 1,
);
echo Sketchfab::embed('cnTC9viItfZ1fdT811NgEVafw1S');

$ php artisan vendor:publish"