PHP code example of kalprajsolutions / bitly

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

    

kalprajsolutions / bitly example snippets


KalprajSolutions\Bitly\BitlyServiceProvider::class,

return [

    'aliases' => [

        'App' => Illuminate\Support\Facades\App::class,
        'Artisan' => Illuminate\Support\Facades\Artisan::class,
        'Auth' => Illuminate\Support\Facades\Auth::class,
        // ...
        'Bitly' => KalprajSolutions\Bitly\Facade\Bitly::class,
    ],

];

$url = app('bitly')->short('https://www.example.com/'); // http://bit.ly/abcdefg

use Bitly;

$url = Bitly::short('https://www.example.com/'); // http://bit.ly/abcdefg

$url = Bitly::proxy('user:[email protected]:80')->short('https://www.example.com/'); // http://bit.ly/abcdefg

$url = Bitly::url('http://example.com')->get(); // http://bit.ly/nHcn3

$url = Bitly::url('http://example.com')
		->title('This will be the title')
		->get();

$url = Bitly::url('http://example.com')
		->proxy('user:pass@localhost:8125')
		->get();


$url = Bitly::url('http://example.com')
		->proxy([
			'http'  => 'http://localhost:8125', // Use this proxy with "http"
			'https' => 'http://localhost:9124', // Use this proxy with "https"
		])
		->get();

$url = Bitly::url('http://example.com')
		->tags([
		'First Tag',
		'Second Tag',
		])->get();

$url = Bitly::url('http://example.com')
		->guid('Ba1bc23dE4F')
		->get();

$url = Bitly::url('http://example.com')
		->domain('custom.com')
		->get();

php artisan vendor:publish --provider="KalprajSolutions\Bitly\BitlyServiceProvider"