PHPackages                             rolice/laravel5-domain-authority - 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. rolice/laravel5-domain-authority

ActiveLibrary

rolice/laravel5-domain-authority
================================

Domain Authority Consumer

0.3(10y ago)55622[2 issues](https://github.com/Rolice/laravel5-domain-authority/issues)MITPHPPHP &gt;=5.4.0

Since Jun 10Pushed 8y ago1 watchersCompare

[ Source](https://github.com/Rolice/laravel5-domain-authority)[ Packagist](https://packagist.org/packages/rolice/laravel5-domain-authority)[ RSS](/packages/rolice-laravel5-domain-authority/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (3)Versions (2)Used By (0)

laravel5-domain-authority
=========================

[](#laravel5-domain-authority)

Domain authority API consumer for Laravel 5 and inclusively any composer project, relying on [Moz](http://moz.com).

This package is designed to consume statistical data from Moz API service. In order to utilize the functionality you should have at least free moz account, which can be registered here: .

The API provide SEO, ranking and authority statistics about a websites, specific domains or subdomains, single pages and internal/external linking.

This package is in basic development phase and not all fields and functionalities are covered. However the base is ready and it is matter of definition to fulfill other property data. Link metrics are missing and batch domain requests are not implemented as well.

The package is tested only on Laravel 5. It can be adapted for Laravel 4 easily as it does not depend on the framework heavily.

Feel free to fork and commit improvements and extensions of the project. The issues section is open for comments, problem reports and suggestions.

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

[](#requirements)

Installations via composer exclusively will require **64-bit version of PHP**, due to high values in the bit-fields, used to query Moz API. A fix is not planned currently for **32-bit versions of PHP**, since it will require major extension to support it without crapping the style with hardcoded values as strings.

With manual installation it will work correctly util the column value or bitwise sum of columns for mozspace API exceed integer size on 32-bit platforms (32-bit builds of PHP).

Read more about this issue on [URL Metrics](https://github.com/Rolice/laravel5-domain-authority/wiki/Url-Metrics) page in the project Wiki.

Implementation Level (Supported API)
------------------------------------

[](#implementation-level-supported-api)

Here is defined the progress of implementation against Moz API. End-points marked with **+** are implemented, those with **-** are not.

- Anchor Text Metrics (-)
- Link Metrics (-)
- Top Pages (-)
- URL Metrics (+)
- Index Metadata (-)

### Additional Features

[](#additional-features)

- Domain Age Calculator - an interface gathering registration/creation/activation date of a domain and age calculation.

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

[](#installation)

The installation process is extremely easy with composer.

Use for production installations:

`composer require 'rolice/laravel5-domain-authority:0.3.2'` (production, stable)

Latest development version:

`composer require 'rolice/laravel5-domain-authority:dev-master'` (latest, unstable)

Once the package is set up for you with the help of composer you have to define service provider and aliases in the application config file, located at `/config/app.php`.

```
    'providers' => [
        // ...
        // ...
        'DomainAuthority\ServiceProvider',
    ],

    // ...

    'aliases' => [
        // ...
        // ...
        'DomainAge'             => 'DomainAuthority\DomainAge',
        'DomainAuthority'       => 'DomainAuthority\DomainAuthority',
        'UrlMetrics'            => 'DomainAuthority\UrlMetrics',
    ],
```

The two records in aliases section will allow you to use these classes directly into the views, without calling them through their full namespace.

After you are done you have to publish the the package through the following artisan command:

`php artisan vendor:publish`

This is required in order to publish the config of the package directly in application config folder. You will find there the new file named `domainauthority.php`. Edit it and enter the data from your Moz account service authorization:

- *Access ID*
- *Secret Key*

They can be obtained from the \[**Access** section of your **API Dashboard** in Moz\] ().

Now you are ready to consume the data.

Usage
-----

[](#usage)

Currently only URL metrics are implemented. An example how to collect title data and domain authority about an URL is written below:

```
// Gather data in controller, model or anywhere it is appropriate to do so
$data = App::make('DomainAuthority')
    ->urlMetrics('www.seomoz.org', UrlMetrics::DomainAuthority | UrlMetrics::Title);

// Display results somewhere in the views with Blade template engine
{{ $data->DomainAuthority }} / {{ $data->Title }}
```

The `get` method of the `DomainAuthority` requires an URL address and columns. The columns are passed in the same style as for the Moz API - in bit field. The result is an instance of `UrlMetrics`, with fields named same way as the columns requested (the class constants).

**Caution**: These fields are dynamically generated with the help of `__get` magic method and `ReflectionClass`. They are not defined in the `UrlMetrics` class. Some functions like `proprty_exists` may fail on detecting them.

### Domain Age Usage

[](#domain-age-usage)

You can use Domain Age interface fairly easily. It works with who.is website and parses the dates from their response. The class is named `DomainAge`. It contains three methods:

- since - method that retrieves the registration date of a domain
- age - method that calls since and gives the current age of a domain, measured in years
- fromDate - directly calcualate age by given date in string format, again, in years

```
$since = App::make('DomainAge')->since($this->item->url); // The $since variable will contain Carbon instance or null on failure
$age =  App::make('DomainAge')->age($this->item->url); // Will contain int with years of age, months and others are ignored
$age2 = DomainAge::fromDate('2010-10-01'); // This will calculate directly age from the given date, useful with previously stored values

```

**Inpotant**: Keep in mind that `since` and `age` methods will produce cURL request to who.is website, and exceeding certain limits may result in temporarily unavailable service or ban. A good idea here is to store domain birth date returned from `since` method in some data repository (DB, FileSystem, etc.) and use `fromDate` to directly get age later without new requests.

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance12

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity48

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

Unknown

Total

1

Last Release

3995d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/749cf1dfa9fd70be7bbcb900213e22ded804858f6e92baadabc6456536eb18ce?d=identicon)[rolice](/maintainers/rolice)

---

Top Contributors

[![Juddling](https://avatars.githubusercontent.com/u/2891373?v=4)](https://github.com/Juddling "Juddling (1 commits)")

---

Tags

authoritymozdomainauthority

### Embed Badge

![Health badge](/badges/rolice-laravel5-domain-authority/health.svg)

```
[![Health](https://phpackages.com/badges/rolice-laravel5-domain-authority/health.svg)](https://phpackages.com/packages/rolice-laravel5-domain-authority)
```

###  Alternatives

[barryvdh/laravel-ide-helper

Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.

14.9k123.0M687](/packages/barryvdh-laravel-ide-helper)[laravel/ui

Laravel UI utilities and presets.

2.7k134.9M601](/packages/laravel-ui)[tucker-eric/eloquentfilter

An Eloquent way to filter Eloquent Models

1.8k4.8M26](/packages/tucker-eric-eloquentfilter)[orchestra/canvas

Code Generators for Laravel Applications and Packages

20917.2M158](/packages/orchestra-canvas)[sammyjo20/lasso

Lasso - Asset wrangling for Laravel made simple.

355347.9k](/packages/sammyjo20-lasso)[erag/laravel-disposable-email

A Laravel package to detect and block disposable email addresses.

226102.4k](/packages/erag-laravel-disposable-email)

PHPackages © 2026

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