Package Data | |
---|---|
Maintainer Username: | fitztrev |
Maintainer Contact: | info@manulith.com (Manulith) |
Package Create Date: | 2014-07-10 |
Package Last Update: | 2016-10-13 |
Home Page: | https://manulith.com |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2024-12-26 15:25:27 |
Package Statistics | |
---|---|
Total Downloads: | 980 |
Monthly Downloads: | 0 |
Daily Downloads: | 0 |
Total Stars: | 1 |
Total Watchers: | 3 |
Total Forks: | 0 |
Total Open Issues: | 1 |
This is a Laravel package for uploading 3D objects to the Sketchfab API.
"manulith/sketchfab-php": "dev-master"
to composer.json.composer update
$ php artisan vendor:publish"
Then, set your API key in config/sketchfab.php
Simple:
<?php
$file = '/path/to/file.stl';
$response = Sketchfab::upload($file);
echo $response['uid'];
With optional parameters:
<?php
$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'];
<?php
$response = Sketchfab::status('cnTC9viItfZ1fdT811NgEVafw1S');
echo $response['processing'];
<?php
$response = Sketchfab::info('cnTC9viItfZ1fdT811NgEVafw1S');
print_r($response);
Simple:
<?php
echo Sketchfab::embed('cnTC9viItfZ1fdT811NgEVafw1S');
With optional parameters:
<?php
$options = array(
'width' => 320, // or '100%'
'height' => 280,
'ui_infos' => 1,
'ui_controls' => 1,
'ui_stop' => 1,
'autostart' => 1,
);
echo Sketchfab::embed('cnTC9viItfZ1fdT811NgEVafw1S');