PHPackages                             ruwer/toparticles - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. ruwer/toparticles

AbandonedArchivedLibrary[Utility &amp; Helpers](/categories/utility)

ruwer/toparticles
=================

Get the top read articles of your page.

75.8kPHP

Since Jul 8Pushed 9y agoCompare

[ Source](https://github.com/ricardoruwer/TopArticles)[ Packagist](https://packagist.org/packages/ruwer/toparticles)[ RSS](/packages/ruwer-toparticles/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependenciesVersions (1)Used By (0)

TopArticles for Laravel 5
=========================

[](#toparticles-for-laravel-5)

- A Laravel 5 package used to list your top articles by date.
- Uses Google Analytics API.

First of all
------------

[](#first-of-all)

#### 1.

[](#1)

- Go to:
- Create credentials
- Service account key
- New service account
- Put the name, select JSON and Create!

#### 2.

[](#2)

- Open the downloaded file.
- Copy the e-mail at "client\_email".
- Go to:
- Admin
- Select your account and go to User Management
- Paste the e-mail on the input and Add!
- Now copy the JSON file to your project.

Instalation
-----------

[](#instalation)

```
composer require "ruwer/toparticles":"dev-master"
```

Add to your **config/app.php**:

```
'providers' => [
    //...
    Ruwer\TopArticles\TopArticlesServiceProvider::class,
],
```

and:

```
'aliases' => [
    //...
    'TopArticles' => Ruwer\TopArticles\TopArticlesFacade::class,
],
```

In your terminal:

```
php artisan vendor:publish --provider="Ruwer\TopArticles\TopArticlesServiceProvider"
```

```
composer dump-autoload
```

Now open the file: **config/analytics.php** and configure the path of your JSON file generated by Google Analytics.

How to use
----------

[](#how-to-use)

In your controller:

```
use TopArticles;

TopArticles::get(
    "ga:xxxxxxxx", //Your Google Analytics Profile ID
    "7daysAgo", //Begin Date
    "today", //End date (you can also use Y-m-d)
    "(articles/)", //Regex for Filters (everything containing "articles/")
    10 //Results
);

//It'll return an array with your top viewed articles :)
```

###  Health Score

25

—

LowBetter than 35% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/7904540?v=4)[Ricardo Ruwer](/maintainers/ricardoruwer)[@ricardoruwer](https://github.com/ricardoruwer)

### Embed Badge

![Health badge](/badges/ruwer-toparticles/health.svg)

```
[![Health](https://phpackages.com/badges/ruwer-toparticles/health.svg)](https://phpackages.com/packages/ruwer-toparticles)
```

###  Alternatives

[dueros/bot-sdk

度秘bot开发的PHP SDK

7414.7k1](/packages/dueros-bot-sdk)[mwdelaney/sage-fonts-preload

Automatically preload fonts from the Sage mix manifest

188.5k](/packages/mwdelaney-sage-fonts-preload)

PHPackages © 2026

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