PHP code example of marvinosswald / filament-activity-log

1. Go to this page and download the library: Download marvinosswald/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/ */

    

marvinosswald / filament-activity-log example snippets


ActivityLogEntry::make()
->with('shippingAddress.activities')
->formatDescriptionUsing(fn(Activity $activity) => $activity->description)
->formatSubjectUsing(function (Activity $activity) {
    if ($activity->subject_type == OrderAddress::class) {
        return __("models.{$activity->subject_type}", ['type' => $activity->subject->type]);
    }
    return __("models.{$activity->subject_type}");
})
bash
php artisan vendor:publish --tag="filament-activity-log-views"