• Stars
    star
    134
  • Rank 271,059 (Top 6 %)
  • Language
    PHP
  • License
    MIT License
  • Created over 1 year ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Spatie activity log integration into Filament

header

Filament Activity Log

Latest Version on Packagist Software License GitHub Workflow Status Total Downloads

This package adds a page to the Filament Admin panel to view the activity log generated by spatie/laravel-activitylog.

Screenshot

Installation

Plugin Version Filament Version PHP Version
0.1.x 2.x > 8.0
1.x 3.x > 8.1

Install via Composer.

Requires PHP 8.0 and Filament 2.0

composer require pxlrbt/filament-activity-log

Warning This plugin only offers a page to show activities related to your model. You need spatie/laravel-activitylog installed and configured for it to work. It is important you are using the LogsActivity trait as per Spatie's docs for this work as we use the '->activities()' method of the trait.

Usage

Make sure you use a custom theme and the vendor folder for this plugins is published, so that it includes the Tailwind CSS classes.

Create a page

Create the page inside your resources Pages/ directory. Replace UserResource with your resource.

<?php

namespace App\Filament\Resources\UserResource\Pages;

use pxlrbt\FilamentActivityLog\Pages\ListActivities;

class ListUserActivities extends ListActivities
{
    protected static string $resource = UserResource::class;
}

Register the page

Add the page to your resource's getPages() method.

public static function getPages(): array
{
    return [
        'index' => Pages\ListUsers::route('/'),
        'create' => Pages\CreateUser::route('/create'),
        'activities' => Pages\ListUserActivities::route('/{record}/activities'),
        'edit' => Pages\EditUser::route('/{record}/edit'),
    ];
}

Link to your page

Use a Filament action to link to your from your table or page.

$table->actions([
    Action::make('activities')->url(fn ($record) => YourResource::getUrl('activities', ['record' => $record]))
]);

Contributing

If you want to contribute to this packages, you may want to test it in a real Filament project:

  • Fork this repository to your GitHub account.
  • Create a Filament app locally.
  • Clone your fork in your Filament app's root directory.
  • In the /filament-activity-log directory, create a branch for your fix, e.g. fix/error-message.

Install the packages in your app's composer.json:

"require": {
    "pxlrbt/filament-activity-log": "dev-fix/error-message as main-dev",
},
"repositories": [
    {
        "type": "path",
        "url": "filament-activity-log"
    }
]

Now, run composer update.

More Repositories

1

move-wsl

Easily move your WSL distros VHDX file to a new location.
PowerShell
1,411
star
2

filament-excel

Excel Export for Filament Admin Resources
PHP
330
star
3

filament-spotlight

Quickly navigate your Filament pages
PHP
223
star
4

filament-environment-indicator

Never confuse your tabs with different Filament environments again.
PHP
110
star
5

laravel-pdfable

Keep your PDFs logic in one place.
PHP
38
star
6

php-scoper-prefix-remover

PHP
10
star
7

cobalt2-jetbrains

Cobalt2 Theme for Jetbrains IDE.
Sass
9
star
8

markdown-css

Modern CSS style for nicely formatted markdown exports.
CSS
9
star
9

third-party-checker

Quickly check your websites for third party requests.
JavaScript
9
star
10

acf-configurator

A wrapper for easy local Advanced Custom Fields configuration in php.
PHP
8
star
11

wordpress-notifier

WordPress Notifier is an object oriented helper library for handling WordPress admin notices inside a plugin or theme. It supports persistent notices and dismissible notices out of the box and is extendable.
PHP
4
star
12

lightroom-filematcher

PHP Scripts that matches LR meta data to local files and renames them
PHP
3
star
13

wordpress-cf7-cleverreach-integration

WordPress Plugin: Integrates CleverReachยฎ into Contact Form 7
PHP
2
star
14

filament-translate-action

PHP
1
star
15

website-diff

Utility tool that bundles a crawler and BackstopJS for visual regression testing.
JavaScript
1
star
16

wordpress-cf7-weclapp-integration

Wordpress Plugin: Integrates WeClapp into Contact Form 7 forms
PHP
1
star
17

faker-better-unique

Replaces the default Faker with an extended Faker instance that adds `betterUnique()` โ€“ `unique()` based on a key.
PHP
1
star