PHPackages                             toneflix-code/adf-ly-laravel - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. toneflix-code/adf-ly-laravel

ActiveLibrary[API Development](/categories/api)

toneflix-code/adf-ly-laravel
============================

A laravel package that wraps around Adf.ly API library.

2.0.0(4y ago)07MITPHPPHP ^7.4|^8.0

Since May 22Pushed 4y agoCompare

[ Source](https://github.com/toneflix/adf-ly-laravel)[ Packagist](https://packagist.org/packages/toneflix-code/adf-ly-laravel)[ Docs](https://github.com/toneflix/adf-ly-laravel)[ RSS](/packages/toneflix-code-adf-ly-laravel/feed)WikiDiscussions main Synced today

READMEChangelog (2)Dependencies (3)Versions (3)Used By (0)

Adf.ly Laravel API wrapper
==========================

[](#adfly-laravel-api-wrapper)

[![Latest Version on Packagist](https://camo.githubusercontent.com/520fdd5bd0f076fadc0df78263aa9c303083002cf880da18fb90f51aceb786e0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f746f6e65666c69782d636f64652f6164662d6c792d6c61726176656c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/toneflix-code/adf-ly-laravel)[![Total Downloads](https://camo.githubusercontent.com/7df1a107815b74b327024c38124cd0fc2cae5ce8dd915185fdac37ef875fb06f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f746f6e65666c69782d636f64652f6164662d6c792d6c61726176656c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/toneflix-code/adf-ly-laravel)

[![Laravel8|9](https://camo.githubusercontent.com/7d3d86083aee0a915626c7840ac4732d5accc39a6d706f9a6afb32c31ab2f3f8/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c61726176656c2d38253743392d6f72616e67652e737667)](http://laravel.com)[![License](https://camo.githubusercontent.com/850eae1099d2b05f53383473d7cd51f9bc1ab09b7d0d9e5122f1dd930efdcc6d/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6d6173686170652f6170697374617475732e737667)](https://packagist.org/packages/toneflix-code/adf-ly-laravel)

This library is a simple laravel package that wraps around Adf.ly API implementations.

Please refere to [Adf.ly API Documentation](https://login.adf.ly/static/other/adfly_api_v1_documentation.pdf?v=20191108) for detailed api use description.

Requirements
------------

[](#requirements)

- [PHP &gt;= 7.41](http://php.net/)
- [Laravel 8|9](https://github.com/laravel/framework)

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require toneflix-code/adf-ly-laravel
```

#### Service Provider &amp; Facade (Optional on Laravel 5.5+)

[](#service-provider--facade-optional-on-laravel-55)

Register provider and facade on your `config/app.php` file.

```
'providers' => [
    ...,
    ToneflixCode\AdfLy\AdfLyServiceProvider::class,
]

'aliases' => [
    ...,
    'AdfLy' => ToneflixCode\AdfLy\AdfLyFacade::class,
]
```

#### Configuration (Optional)

[](#configuration-optional)

```
php artisan vendor:publish --provider="ToneflixCode\AdfLy\AdfLyServiceProvider"
```

API Keys
--------

[](#api-keys)

To start using this library you are required to configure your API keys in your .env file with these variables

```
ADFLY_SECRET_KEY=your-adf.ly secret key
ADFLY_PUBLIC_KEY=your-adf.ly public key
ADFLY_USER_ID=your-adf.ly user ID

```

Usage
-----

[](#usage)

### Shorten Url

[](#shorten-url)

```
use ToneflixCode\AdfLy\AdfLy;
$adfly = new AdfLy;
$res = $adfly->shorten(array('http://stackoverflow.com/users'), 'q.gs');

$shortenedUrl1 = $res['data'][0];
$hash1 = substr($shortenedUrl1['short_url'],strrpos($shortenedUrl1['short_url'],'/')+1);
echo 'First URL shortened (' . $hash1 . '): ' . print_r($res);

$res = $adfly->shorten(array('http://www.reddit.com'), 'q.gs');
$shortenedUrl2 = $res['data'][0];
$hash2 = substr($shortenedUrl2['short_url'],strrpos($shortenedUrl2['short_url'],'/')+1);
echo 'Another URL shortened (' . $hash2 . '): ' . print_r($res);

$res = $adfly->shorten(array('www.youtube.com'), 'q.gs', 'banner');
$shortenedUrl3 = $res['data'][0];
echo 'Another URL shortened: ' . print_r($res);

$res = $adfly->shorten(array('http://www.len10.com/videos/'), 'q.gs', 'int', 13);
$shortenedUrl4 = $res['data'][0];
echo 'Another URL shortened: ' . print_r($res);
```

#### Parameters

[](#parameters)

```
function shorten(
    array $urls,
    $domain = false,
    $advertType = false,
    $groupId = false,
    $title = false,
    $customName = false
)
```

Expand.
-------

[](#expand)

```
print_r($adfly->expand(array($shortenedUrl3['short_url'],$shortenedUrl4['short_url']),array($hash1,$hash2)));
```

LISTING
-------

[](#listing)

```
// List Urls
$urlList = $adfly->getUrls();
print_r($urlList);

// Update Url
$adfly->updateUrl($shortenedUrl1['id'], 'http://modifiedurlaaaa.cat', "int", "The  updated URL", 13, false, false);
print_r($adfly->expand(array(),array($hash1)));

foreach($urlList['data'] as $url){
    $adfly->deleteUrl($url['id']);
}

//List Urls again
$urlList = $adfly->getUrls();
print_r($urlList);
```

GROUPS
------

[](#groups)

```
$g = $adfly->createGroup('API Group');
print_r($g);

$g = $adfly->getGroups(1);
print_r($g);
```

REFERRERS GET
-------------

[](#referrers-get)

```
$res = $adfly->getReferrers();
print_r($res);
```

COUNTRIES GET
-------------

[](#countries-get)

```
$res = $adfly->getCountries();
print_r($res);
```

ANNOUNCEMENTS GET
-----------------

[](#announcements-get)

```
$res = $adfly->getAnnouncements();
print_r($res);
```

publisherReferralStats GET
--------------------------

[](#publisherreferralstats-get)

```
$res = $adfly->getPublisherReferrals();
print_r($res);
```

advertiserReferralStats GET
---------------------------

[](#advertiserreferralstats-get)

```
$res = $adfly->getAdvertiserReferrals();
print_r($res,1);
```

withdrawalTransactions GET
--------------------------

[](#withdrawaltransactions-get)

```
$res = $adfly->getWithdrawalTransactions();
print_r($res,1);
```

withdraw GET
------------

[](#withdraw-get)

```
$res = $adfly->getWithdraw();
print_r($res,1);
```

withdraw request GET
--------------------

[](#withdraw-request-get)

```
$res = $adfly->withdrawRequestInitiate();
print_r($res,1);
```

withdraw request DELETE
-----------------------

[](#withdraw-request-delete)

```
$res = $adfly->withdrawRequestCancel();
print_r($res,1);
```

publisher Stats GET
-------------------

[](#publisher-stats-get)

```
$res = $adfly->getPublisherStats();
print_r($res,1);
```

user Profile GET
----------------

[](#user-profile-get)

```
$res = $adfly->getProfile();
print_r($res,1);
```

advertiser Campaigns GET
------------------------

[](#advertiser-campaigns-get)

```
$res = $adfly->getAdvertiserCampaigns();
print_r($res,1);
```

advertiser Graph GET
--------------------

[](#advertiser-graph-get)

```
$res = $adfly->getAdvertiserGraph(null,156);
print_r($res,1);
```

advertisers Campaign parts GET
------------------------------

[](#advertisers-campaign-parts-get)

```
$res = $adfly->getAdvertiserCampaignParts(739026);
print_r($res,1);
```

auth POST
---------

[](#auth-post)

```
$res = $adfly->auth('1', '2');
print_r($res,1);
```

account publisher referrals
---------------------------

[](#account-publisher-referrals)

```
$res = $adfly->getAccountPubReferrals('', '', 1);
print_r($res);
```

account advertiser referrals
----------------------------

[](#account-advertiser-referrals)

```
$res = $adfly->getAccountAdvReferrals('', '', 1);
print_r($res);
```

account popad referrals
-----------------------

[](#account-popad-referrals)

```
$res = $adfly->getAccountPopReferrals('', '', 1);
print_r($res);
```

account total referrals
-----------------------

[](#account-total-referrals)

```
$res = $adfly->getAccountTotalReferrals();
print_r($res);
```

Domains
-------

[](#domains)

```
$res = $adfly->getDomains();
print_r($res);
```

update account details
----------------------

[](#update-account-details)

```
$res = $adfly->updateAccountDetails([]);
print_r($res);
```

update account password
-----------------------

[](#update-account-password)

```
$res = $adfly->updatePassword('oldpassword', 'newpassword', 'newpassword');
print_r($res);
```

get account countries
---------------------

[](#get-account-countries)

```
$res = $adfly->getAccountCountries();
print_r($res);
```

get account details
-------------------

[](#get-account-details)

```
$res = $adfly->getAccountDetails();
print_r($res);
```

### Testing

[](#testing)

```
composer test
```

### Changelog

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

### Security

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Toneflix Code](https://github.com/toneflix)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

24

—

LowBetter than 31% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

1503d ago

Major Versions

1.0.0 → 2.0.02022-05-22

### Community

Maintainers

![](https://www.gravatar.com/avatar/4638f9de973d94753ebff641af3009e1049064f9a6bd76fe87e58d0d8ddd7ca7?d=identicon)[3m1n3nc3](/maintainers/3m1n3nc3)

---

Top Contributors

[![3m1n3nc3](https://avatars.githubusercontent.com/u/52163001?v=4)](https://github.com/3m1n3nc3 "3m1n3nc3 (17 commits)")

---

Tags

laravelAdflytoneflix

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/toneflix-code-adf-ly-laravel/health.svg)

```
[![Health](https://phpackages.com/badges/toneflix-code-adf-ly-laravel/health.svg)](https://phpackages.com/packages/toneflix-code-adf-ly-laravel)
```

###  Alternatives

[defstudio/telegraph

A laravel facade to interact with Telegram Bots

816333.6k3](/packages/defstudio-telegraph)[simplestats-io/laravel-client

Server-side analytics for Laravel that follows the full funnel from visit to registration to payment, attributed to the channel that drove it. Revenue, MRR, churn and ad-spend profit (ROAS/CAC) per channel. GDPR compliant, ad-blocker proof.

5021.9k](/packages/simplestats-io-laravel-client)[riclep/laravel-storyblok

A Laravel wrapper around the Storyblok API to provide a familiar experience for Laravel devs

6279.6k5](/packages/riclep-laravel-storyblok)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
