ndrd/lumen-bitly
Composer 安装命令:
composer require ndrd/lumen-bitly
包简介
Laravel package for generating bitly url
README 文档
README
A laravel package for generating Bitly urls
For more information see Bitly
Requirements
Laravel 5.1 or later
Installation
Installation is a quick 3 step process:
- Download laravel-bitly using composer
- Enable the package in app.php
- Configure your Bitly credentials
- (Optional) Configure the package facade
Step 1: Download laravel-bitly using composer
Add shivella/laravel-bitly by running the command:
composer require shivella/laravel-bitly
Step 2: Enable the package in app.php
Register the Service in: config/app.php
Shivella\Bitly\BitlyServiceProvider::class,
Step 3: Configure Bitly credentials
php artisan vendor:publish --provider="Shivella\Bitly\BitlyServiceProvider"
Add this in you .env file
BITLY_ACCESS_TOKEN=your_secret_bitly_access_token
Step 4 (Optional): Configure the package facade
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,
Usage
$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
统计信息
- 总下载量: 37
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-10-24