PHPackages                             thanosalexander/activity - 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. thanosalexander/activity

ActiveLibrary

thanosalexander/activity
========================

This package keeps activities for various actions

1.0.0(10y ago)115MITPHPPHP &gt;=5.3

Since Jan 13Pushed 10y ago1 watchersCompare

[ Source](https://github.com/thanosalexander/activities)[ Packagist](https://packagist.org/packages/thanosalexander/activity)[ Docs](https://github.com/thanosalexander/activities)[ RSS](/packages/thanosalexander-activity/feed)WikiDiscussions master Synced 2mo ago

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

Activities tracking for Laravel
===============================

[](#activities-tracking-for-laravel)

Tracks activities fired when specific types happened.

---

[![Build Status](https://camo.githubusercontent.com/dd6cfaeffe482df4d3ee196922639aa4178bdfd36753c97e22ca51ca91172156/68747470733a2f2f7472617669732d63692e6f72672f7468616e6f73616c6578616e6465722f616374697669746965732e7376673f6272616e63683d6d6173746572)](http://travis-ci.org/thanosalexander/activities)[![Latest Stable Version](https://camo.githubusercontent.com/92fe055817dd25cae47b101d016dd2656ac88f0f13216964202d0185a9ad8ef2/68747470733a2f2f706f7365722e707567782e6f72672f7468616e6f73616c6578616e6465722f61637469766974792f762f737461626c65)](https://packagist.org/packages/thanosalexander/activity)[![Total Downloads](https://camo.githubusercontent.com/2d4621a0deae3e673ae82ad82ee4e20099f26e2375ad36801a28943105f85318/68747470733a2f2f706f7365722e707567782e6f72672f7468616e6f73616c6578616e6465722f61637469766974792f646f776e6c6f616473)](https://packagist.org/packages/thanosalexander/activity)[![Latest Unstable Version](https://camo.githubusercontent.com/3d614dd34361d28e71b7566ae715d5afb3b16a66f2cfd0c578f7b3d37e556336/68747470733a2f2f706f7365722e707567782e6f72672f7468616e6f73616c6578616e6465722f61637469766974792f762f756e737461626c65)](https://packagist.org/packages/thanosalexander/activity)[![License](https://camo.githubusercontent.com/f9e43e900f6b625e1d214798da24428fcfe139838f8d5fde3afe252edd887b82/68747470733a2f2f706f7365722e707567782e6f72672f7468616e6f73616c6578616e6465722f61637469766974792f6c6963656e7365)](https://packagist.org/packages/thanosalexander/activity)

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

[](#installation)

To get the latest version of Activities simply require it in your `composer.json` file.

```
"thanosalexander/activity":"~1.0"

```

You'll then need to run `composer install` to download it and have the autoloader updated.

Once Activities is installed you need to register the service provider with the application. Open up `config/app.php` and find the `providers` key.

```
'providers' => array(
    ...
    ...
    \Thanosalexander\Activity\ActivityServiceProvider::class,

)
```

Activities also ships with two facades which provides the static syntax for creating activities. You can register the facade in the `aliases` key of your `config/app.php` file.

```
'aliases' => array(

    ...
    ..

    'Activity' => \Thanosalexander\Activity\Facades\Activity::class,
    'Type' => \Thanosalexander\Activity\Facades\Type::class

)
```

### Publish the configurations

[](#publish-the-configurations)

Run this on the command line from the root of your project:

```
$ php artisan vendor:publish

```

A configuration file will be publish to `config/activities.php`Also the migrations will be published into migrations folder!

### Run the migrations

[](#run-the-migrations)

Activities package comes with two tables, `activities_types` and `activities`. Just go to terminal and run

```
$ php artisan migrate

```

Now the tables are created!

Usage
-----

[](#usage)

Create a new Type

```
$type= \Type::create([
            'name'=>'login',
            'description'=>'login action',
            'label'=>'Login'
        ]);
```

> All the fields are required in order to create an activity type! Also the `name` is unique!

Create a new Activity

```
$activity = \Activity::create([
            'user_id'=>0,
            'type_id'=>3,
            'content'=>'The content of this action',
            'ip'=> \Illuminate\Support\Facades\Request::getClientIp()
        ]);
```

> The `user_id` field is not required in order to create an Activity! However for guest users actions the field will be `nullable`

Controllers
-----------

[](#controllers)

The package comes with two controllers `TypeController` and `ActivityController`. They are almost resource controller with very simple syntax.

#### Activities Routes

[](#activities-routes)

```
 /**
     * Activities Routes
     */
    Route::get('activities',array(
        'uses'=>'thanosalexander\activity\Http\Controllers\ActivityController@index',
        'as'=>'activities.index'
    ));
    Route::post('activities/create',array(
        'uses'=>'thanosalexander\activity\Http\Controllers\ActivityController@store',
        'as'=>'activities.store'
    ));
    Route::put('activities/update/{id}',array(
        'uses'=>'thanosalexander\activity\Http\Controllers\ActivityController@update',
        'as'=>'activities.update'
    ));
    Route::get('activities/show/{id}',array(
        'uses'=>'thanosalexander\activity\Http\Controllers\ActivityController@show',
        'as'=>'activities.show'
    ));
    Route::delete('activities/delete/{id}',array(
        'uses'=>'thanosalexander\activity\Http\Controllers\ActivityController@delete',
        'as'=>'activities.delete'
    ));

```

#### Types Routes

[](#types-routes)

```
/**
     * Types Routes
     */
    Route::get('types',array(
        'uses'=>'thanosalexander\activity\Http\Controllers\TypeController@index',
        'as'=>'types.index'
    ));
    Route::post('types/create',array(
        'uses'=>'thanosalexander\activity\Http\Controllers\TypeController@store',
        'as'=>'types.store'
    ));
    Route::put('types/update/{id}',array(
        'uses'=>'thanosalexander\activity\Http\Controllers\TypeController@update',
        'as'=>'types.update'
    ));
    Route::get('types/show/{id}',array(
        'uses'=>'thanosalexander\activity\Http\Controllers\TypeController@show',
        'as'=>'types.show'
    ));
    Route::delete('types/delete/{id}',array(
        'uses'=>'thanosalexander\activity\Http\Controllers\TypeController@delete',
        'as'=>'types.delete'
    ));

```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity58

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

3774d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/b361cf343ffc422d80f22af953fde68d69156388c0ce6c1824a7308f02638467?d=identicon)[thanosalexander](/maintainers/thanosalexander)

---

Top Contributors

[![thanosalexander](https://avatars.githubusercontent.com/u/6491808?v=4)](https://github.com/thanosalexander "thanosalexander (32 commits)")

---

Tags

phplaravelactivities

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/thanosalexander-activity/health.svg)

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

###  Alternatives

[octw/aramex

A Library to integrate with Aramex APIs

2925.2k](/packages/octw-aramex)

PHPackages © 2026

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