elmsellem / laravel-bitly
Laravel 包用于生成 Bitly 短链接
v1.0.0
2022-04-17 18:33 UTC
Requires
- php: >=7.4
- illuminate/http: ^7.0 || ^8.0 || ^9.0
This package is auto-updated.
Last update: 2024-09-17 23:40:29 UTC
README
用于生成 Bitly 短链接的 Laravel 包。
更多信息请参阅 Bitly
使用 composer 下载 laravel-bitly
composer require elmsellem/laravel-bitly
配置 Bitly 凭据
php artisan vendor:publish --provider="Elmsellem\Bitly\BitlyServiceProvider"
在您的 .env 文件中添加以下内容
BITLY_ACCESS_TOKEN=your_secret_bitly_access_token
用法
<?php $url = app('bitly')->getShortenUrl('https://www.google.com/'); // https://bit.ly/3uOZj27
使用外观
<?php use Bitly; $url = Bitly::getShortenUrl('https://www.google.com/'); // https://bit.ly/3uOZj27