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

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

backpack/activity-log
=====================

Activity Log for Backpack

2.1.0(6mo ago)3487.5k↑15.1%6[6 issues](https://github.com/Laravel-Backpack/activity-log/issues)[1 PRs](https://github.com/Laravel-Backpack/activity-log/pulls)1MITPHPCI failing

Since Aug 31Pushed 4mo ago7 watchersCompare

[ Source](https://github.com/Laravel-Backpack/activity-log)[ Packagist](https://packagist.org/packages/backpack/activity-log)[ Docs](https://github.com/backpack/activity-log)[ RSS](/packages/backpack-activity-log/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (4)Versions (14)Used By (1)

Activity Log
============

[](#activity-log)

[![Latest Version on Packagist](https://camo.githubusercontent.com/750442150e1feb9c4fe1de994ebbee255070be5ef92062f361637c4126e3ddac/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6261636b7061636b2f61637469766974792d6c6f672e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/backpack/activity-log)[![Total Downloads](https://camo.githubusercontent.com/cb0b980807d10064e9dc9e9bf575e994bf4de8aabf221437d3d71f379d3e3f22/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6261636b7061636b2f61637469766974792d6c6f672e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/backpack/activity-log)[![The Whole Fruit Manifesto](https://camo.githubusercontent.com/9fc65ecdd629dc33c369f73e0bc051740f01647367c131a574577fea2a5678bb/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f77726974696e672532307374616e646172642d74686525323077686f6c6525323066727569742d627269676874677265656e)](https://github.com/the-whole-fruit/manifesto)

Ever wanted to see WHO changed WHAT and WHEN inside your app? Want to remember all the DB changes your users have done? Well... this package doesn't do that. [`spatie/laravel-activitylog`](https://github.com/spatie/laravel-activitylog) does, and does it very well. This package adds a web interface for it, for projects using [Backpack for Laravel](https://backpackforlaravel.com/). It gives your admin/superadmin the ability to see

- the activities performed *by* certain models;
- the activities performed *on* certain models;
- and more;

How does it all work? Well:

- when a change happens to an Eloquent model, the Spatie package will make a note of it in the database;
- this package adds a web interface, so the admin can see the changes (aka activity log);

Preview
-------

[](#preview)

[![](https://user-images.githubusercontent.com/1032474/205863022-827f3248-a9f3-4d05-896f-5fa7a40227be.gif)](https://user-images.githubusercontent.com/1032474/205863022-827f3248-a9f3-4d05-896f-5fa7a40227be.gif)

**NOTE**: The filters are a [Backpack\\PRO](https://backpackforlaravel.com/products/pro-for-one-project) feature. If you don't have that package the filters won't be available.

Demo
----

[](#demo)

Try it right now, in [our online demo](https://demo.backpackforlaravel.com/admin/activity-log). Edit some entities, and check the [activity logs](https://demo.backpackforlaravel.com/admin/activity-log).

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

[](#installation)

In your Laravel + Backpack project, install this package:

```
# install this interface package:
composer require backpack/activity-log

# add a menu item for it
php artisan backpack:add-menu-content ""
```

But also, if your package didn't already have [`spatie/laravel-activitylog`](https://github.com/spatie/laravel-activitylog) installed and set up, please [follow the installation steps in their docs](https://spatie.be/docs/laravel-activitylog/v4/installation-and-setup). We'll also copy-paste them here, for your convenience:

```
php artisan vendor:publish --provider="Spatie\Activitylog\ActivitylogServiceProvider" --tag="activitylog-config"
php artisan vendor:publish --provider="Spatie\Activitylog\ActivitylogServiceProvider" --tag="activitylog-migrations"
php artisan migrate
```

Usage
-----

[](#usage)

> Note: If your models *are not* configured to create activity logs yet, [read the FAQ on how to log all model events](#how-to-log-model-events-created-updated-deleted-etc). If you are unsure, then you have not configured them to log activities - read it.

### ActivityLog list view

[](#activitylog-list-view)

Use it to browse all activity, filter the view, search the view, etc:

[![Backpack ActivityLog list view](https://user-images.githubusercontent.com/1032474/264732691-b77f1585-08f0-4eb8-88aa-3b4226a65567.png)](https://user-images.githubusercontent.com/1032474/264732691-b77f1585-08f0-4eb8-88aa-3b4226a65567.png)

### ActivityLog show view

[](#activitylog-show-view)

Use it to see details about a particular activity:

[![Backpack ActivityLog show view](https://user-images.githubusercontent.com/1032474/264734509-b13b520f-a732-4f84-be1c-db136e5fa160.png)](https://user-images.githubusercontent.com/1032474/264734509-b13b520f-a732-4f84-be1c-db136e5fa160.png)

### CrudController operations

[](#crudcontroller-operations)

If you want your CrudControllers to show links to their activities, just use one or both of the provided Backpack operations:

- **ModelActivityOperation**: Displays a general button, allowing users to see a comprehensive list of all activities for that Model.
- **EntryActivityOperation**: Adds line buttons to each entry in the list, enabling users to view activity logs specific to individual entries.

#### ModelActivityOperation - on a CrudController, display a link to that Model's activity log

[](#modelactivityoperation---on-a-crudcontroller-display-a-link-to-that-models-activity-log)

Say you have a `UserCrudController`. If you want a new button to show up next to *the `Add User` button*, that will take you to *all of the activities of all Users*, then use `\Backpack\ActivityLog\Http\Controllers\Operations\ModelActivityOperation` on your `UserCrudController`.

```
