GithubHelp home page GithubHelp logo

lakuapik / filament-activity-log Goto Github PK

View Code? Open in Web Editor NEW

This project forked from pxlrbt/filament-activity-log

0.0 0.0 0.0 176 KB

Spatie activity log integration into Filament

License: MIT License

PHP 56.08% Blade 43.92%

filament-activity-log's Introduction

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.

filament-activity-log's People

Contributors

pxlrbt avatar tonypartridge avatar egyweb-mohamed avatar idiegonl avatar fabianpnke avatar saifallak avatar aslanutku avatar fabpl avatar mohamedsabil83 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.