PHP code example of pxlrbt / filament-activity-log

1. Go to this page and download the library: Download pxlrbt/filament-activity-log library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

pxlrbt / filament-activity-log example snippets




namespace App\Filament\Resources\UserResource\Pages;

use pxlrbt\FilamentActivityLog\Pages\ListActivities;

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

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'),
    ];
}

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