PHP code example of toneflix-code / cuttly-laravel

1. Go to this page and download the library: Download toneflix-code/cuttly-laravel 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/ */

    

toneflix-code / cuttly-laravel example snippets


ToneflixCode\Cuttly\CuttlyServiceProvider::class

return [
    ToneflixCode\Cuttly\CuttlyServiceProvider::class,
];

use ToneflixCode\Cuttly\Facades\Cuttly;

$link = 'https://toneflix.com.ng/learning';
$data = Cuttly::regular()->shorten($link);

use ToneflixCode\Cuttly\Facades\Cuttly;

$link = 'https://toneflix.com.ng/learning';
$data = Cuttly::regular()->name('toneflix101')->shorten($link);

use ToneflixCode\Cuttly\Facades\Cuttly;

$link = 'https://cutt.ly/toneflix101';
$data = Cuttly::regular()->edit($link);

use ToneflixCode\Cuttly\Facades\Cuttly;

$link = 'https://cutt.ly/toneflix101';
$data = Cuttly::regular()->name('toneflix404')->userDomain()->unique(1)->edit($link);

use ToneflixCode\Cuttly\Facades\Cuttly;

$link = 'https://cutt.ly/toneflix404';
$data = Cuttly::regular()->stats($link);

use ToneflixCode\Cuttly\Facades\Cuttly;

$link = 'https://cutt.ly/toneflix404';
$data = Cuttly::regular()->delete($link);

use ToneflixCode\Cuttly\Facades\Cuttly;

$link = 'https://toneflix.com.ng/learning';
$data = Cuttly::team()->name('toneflix301')->shorten($link);

use ToneflixCode\Cuttly\Facades\Cuttly;

$link = 'https://cutt.ly/toneflix301';
$data = Cuttly::team()->edit($link);

use ToneflixCode\Cuttly\Facades\Cuttly;

$link = 'https://cutt.ly/toneflix301';
$data = Cuttly::team()->stats($link);

use ToneflixCode\Cuttly\Facades\Cuttly;

$link = 'https://cutt.ly/toneflix404';
$data = Cuttly::team()->delete($link);

use ToneflixCode\Cuttly\Facades\Cuttly;
use ToneflixCode\CuttlyPhp\Exceptions\FailedRequestException;

try {
  $link = 'https://toneflix.com.ng/learning';
  $data = Cuttly::regular()->name('toneflix404')->shorten($link);
} catch (FailedRequestException $th) {
  echo $th->getMessage();
}

use ToneflixCode\Cuttly\Facades\Cuttly;
use ToneflixCode\CuttlyPhp\Exceptions\InvalidApiKeyException;
use ToneflixCode\CuttlyPhp\Exceptions\FailedRequestException;

try {
  $link = 'https://toneflix.com.ng/learning';
  $data = Cuttly::regular()->name('toneflix404')->shorten($link);
} catch (FailedRequestException|InvalidApiKeyException $th) {
  echo $th->getMessage();
}