PHP code example of caraxes / try-on

1. Go to this page and download the library: Download caraxes/try-on 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/ */

    

caraxes / try-on example snippets


$repository = app(\TryOn\Repositories\TryOnRepository::class);
$category = $repository->getCategory('T-shirt');
echo $category; // Outputs: tops, bottoms, or one-pieces

$parameters = [
    'message' => [
        'productTitle' => 'Jeans',
        'image' => 'https://example.com/model.jpg',
        'productImage' => 'https://example.com/jeans.jpg'
    ]
];

$result = $repository->tryOn(1, $parameters);
print_r($result);
sh
php artisan vendor:publish --tag=config --provider="TryOn\Providers\TryOnServiceProvider"
bash
php artisan migrate
bash
php artisan queue:work