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\OrderResource\Pages;

use pxlrbt\FilamentActivityLog\Pages\ListActivities;

class ListOrderActivities extends ListActivities
{
    protected static string $resource = OrderResource::class;
}

public static function getPages(): array
{
    return [
        'index' => Pages\ListOrders::route('/'),
        'create' => Pages\CreateOrder::route('/create'),
        'activities' => Pages\ListOrderActivities::route('/{record}/activities'),
        'edit' => Pages\EditOrder::route('/{record}/edit'),
    ];
}

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