PHP code example of spotawheel / laravel-rebrandly

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

    

spotawheel / laravel-rebrandly example snippets


use Rebrandly;

/* Return number of total links */
$string = Rebrandly::countLinks();

/* Create a new short url */
$string = Rebrandly::createLink('https://www.example.com');

/* Search link by slashtag */
$object = Rebrandly::searchLink('2j8ab31');

/* Delete link by slashtag */
$bool = Rebrandly::deleteLink('2j8ab31');

/* Return account details */
$object = Rebrandly::accountDetails();

/* Delete links */
$array = Rebrandly::accountDetails($linksArray);

/* Retrieve links based on filters */
$array = Rebrandly::getLinks(
        string $dateTo = '',
        string $dateFrom = '',
        string $lastLinkId = '',
        int $limit = 25,
        string $domainId = '',
        string $domainFullName = '',
        string $slashtag = '',
        string $creatorId = '',
        string $orderBy = 'createdAt',
        string $orderDir = 'desc'
        );

php artisan vendor:publish --provider="Spotawheel\Rebrandly\RebrandlyServiceProvider"