spotawheel/laravel-rebrandly

Laravel Rebrandly 包

1.0.1 2024-02-22 14:01 UTC

This package is auto-updated.

Last update: 2024-09-22 15:33:39 UTC


README

Rebrandly 的 Laravel 包。

更多信息请见 Rebrandly

安装

步骤 1: 使用 composer 安装 spotawheel/laravel-rebrandly

composer require spotawheel/laravel-rebrandly

步骤 2: 配置 Rebrandly 凭据

php artisan vendor:publish --provider="Spotawheel\Rebrandly\RebrandlyServiceProvider"

在您的 .env 文件中添加以下内容

REBRANDLY_API_KEY=apikey
REBRANDLY_API_URL=https://api.rebrandly.com/v1

使用说明

use Rebrandly;
/* Return number of total links */
$string = Rebrandly::countLinks();

/* Create a new short url */
$string = Rebrandly::createLink('https://www.example.com');

/* Search link by slashtag */
$object = Rebrandly::searchLink('2j8ab31');

/* Delete link by slashtag */
$bool = Rebrandly::deleteLink('2j8ab31');

/* Return account details */
$object = Rebrandly::accountDetails();

/* Delete links */
$array = Rebrandly::accountDetails($linksArray);

/* Retrieve links based on filters */
$array = Rebrandly::getLinks(
        string $dateTo = '',
        string $dateFrom = '',
        string $lastLinkId = '',
        int $limit = 25,
        string $domainId = '',
        string $domainFullName = '',
        string $slashtag = '',
        string $creatorId = '',
        string $orderBy = 'createdAt',
        string $orderDir = 'desc'
        );

注意事项

更多信息请见 Rebrandly 的 API 文档