Package Data | |
---|---|
Maintainer Username: | Shivella |
Maintainer Contact: | wessel.strengholt@gmail.com (Wessel Strengholt) |
Package Create Date: | 2016-12-19 |
Package Last Update: | 2024-11-21 |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2024-12-17 03:01:42 |
Package Statistics | |
---|---|
Total Downloads: | 603,749 |
Monthly Downloads: | 11,419 |
Daily Downloads: | 414 |
Total Stars: | 74 |
Total Watchers: | 2 |
Total Forks: | 27 |
Total Open Issues: | 1 |
A laravel package for generating Bitly urls
For more information see Bitly
Laravel 5.1 or later
Installation is a quick 3 step process:
Add shivella/laravel-bitly by running the command:
composer require shivella/laravel-bitly
Register the Service in: config/app.php
Shivella\Bitly\BitlyServiceProvider::class,
php artisan vendor:publish --provider="Shivella\Bitly\BitlyServiceProvider"
Add this in you .env file
BITLY_ACCESS_TOKEN=your_secret_bitly_access_token
Register the Bitly Facade in: config/app.php
'aliases' => [
'App' => Illuminate\Support\Facades\App::class,
'Artisan' => Illuminate\Support\Facades\Artisan::class,
'Auth' => Illuminate\Support\Facades\Auth::class,
...
'Bitly' => Shivella\Bitly\Facade\Bitly::class,
$url = app('bitly')->getUrl('https://www.google.com/'); // http://bit.ly/nHcn3
Or if you want to use facade, add this in your class after namespace declaration:
use Bitly;
Then you can use it directly by calling Bitly::
like:
$url = Bitly::getUrl('https://www.google.com/'); // http://bit.ly/nHcn3