PHP code example of devkind / rytr-php

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

    

devkind / rytr-php example snippets


use Devkind\RytrPhp;

/** @var \Devkind\RytrPhp */
$rytr  =  new RytrPhp(API_KEY);

/** @var \Devkind\RytrPhp */
$rytr  =  \Devkind\RytrPhp::make(API_KEY);

/** @var \Devkind\RytrPhp\Endpoints\Usercases\BrandName */
$endpoint = $rytr->BrandName->setLanguage('english');

/** @var \Devkind\RytrPhp\Endpoints\Usercases\BrandName */
$endpoint = $rytr->BrandName->setTone('candid');

/** @var \Devkind\RytrPhp\Endpoints\Usercases\BrandName */
$endpoint = $rytr->BrandName->setTone('candid')->setLanguage('english')->setVariation(10);

/** @var \Devkind\RytrPhp\Endpoints\UseCases\BrandName */
$endpoint = $object->BrandName;

$endpoint = $endpoint->get(['brandDescription' => "google"]);

/** @var \Devkind\RytrPhp\Endpoints\UseCases\BrandName */
$endpoint = $object->BrandName;

$endpoint = $endpoint
    ->setBrandDescription("google")
    ->setVariations(10)
    ->setUserId(100)
    ->setFormat('html')
    ->setCreativityLevel('medium')
    ->get();

/** @var \Devkind\RytrPhp\Endpoints\UseCases\BrandName */
$endpoint = $object->BrandName;

$endpoint = $endpoint->generate("google");
bash
composer