manulith/sketchfab-php

A Laravel package for uploading 3D objects to the Sketchfab API.
981 1
Install
composer require manulith/sketchfab-php
Latest Version:v0.1.0
PHP:>=5.4.0
License:MIT
Last Updated:Oct 13, 2016
Links: GitHub  ·  Packagist
Maintainer: fitztrev

Sketchfab PHP

This is a Laravel package for uploading 3D objects to the Sketchfab API.

Installation

  1. Add "manulith/sketchfab-php": "dev-master" to composer.json.
  2. Run composer update
  3. Publish your config
$ php artisan vendor:publish"

Then, set your API key in config/sketchfab.php

Usage

Upload an object

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'];

Check status of an object

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

Get oEmbed info for an object

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

Embed an object

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');

Related Packages

dtisgodsson/twilio

A Laravel 4 wrapper for the Twilio PHP SDK.

3,738 4
wells/l4-ldap-ntlm

An LDAP/Active Directory/NTLM authentication driver for Laravel 4.

3,929 25
fitztrev/laravel-html-minify

Minifies the HTML output of Laravel 4 applications

216,417 413
jlapp/swaggervel

A great way to integrate Swagger into Laravel

966,043 484
sayakb/captcha

Captcha Package for Laravel 4, Fork of mewebstudio/captcha

10,480 8