PHP code example of div-art / shortlink

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

    

div-art / shortlink example snippets


'ShortLink' => \DivArt\ShortLink\Facades\ShortLink::class,

php artisan vendor:publish --provider="DivArt\ShortLink\ShortLinkServiceProvider"
 php
$url = "https://www.google.com";

ShortLink::google($url);

// return https://goo.gl/Njku
 php
$url = https://goo.gl/Njku;

ShortLink::clicks($url);
 php
ShortLink::google(); // return shortener url like goo.gl/XXXXXX

ShortLink::bitly(); // return shortener url like bit.ly/XXXXXX

ShortLink::rebrandly(); // return shortener url like rebrand.ly/XXXXXX

ShortLink::clicks(); // return count of clicks on a shortener url

ShortLink::expand(); // return long url