PHP code example of sunxyw / unify-shorten
1. Go to this page and download the library: Download sunxyw/unify-shorten 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/ */
sunxyw / unify-shorten example snippets
// using Facade
use Sunxyw\Shorten\Facades\Shorten;
Shorten::shorten('AWESOME URL HERE'); // using default provider
Shorten::provider('cuttly')->shorten('AWESOME URL HERE WITH CUTTLY'); // using cuttly provider
// using helper function
shorten('AWESOME URL HERE'); // using default provider
// using Shorten class
use Sunxyw\Shorten\Shorten;
app(Shorten::class)->shorten('AWESOME URL HERE'); // using default provider
app(Shorten::class)->provider('cuttly')->shorten('AWESOME URL HERE WITH CUTTLY'); // using cuttly provider
app(Shorten::class)->gotiny->shorten('AWESOME URL HERE WITH GOTINY'); // using gotiny provider (using magic property)
bash
php artisan vendor:publish --tag="unify-shorten-config"