PHP code example of workup / nova-activitylog

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

    

workup / nova-activitylog example snippets


// in app/Providers/NovaServiceProvder.php

// ...

public function tools()
{
    return [
        // ...
        new \Workup\Nova\ActivityLog\ActivityLog(),
    ];
}

use Illuminate\Database\Eloquent\Model;
use Spatie\ActivityLog\Traits\LogsActivity;

class NewsItem extends Model
{
    use LogsActivity;

    protected $fillable = ['name', 'text'];
    
    protected static $logAttributes = ['name', 'text'];
}

use Workup\Nova\ActivityLog\Resources\ActivityLog;

class Activity extends ActivityLog
{
    public function filters(Request $request)
    {
        return [
            // Your customize filters, etc...
            new Filters\LogsType(),
        ];
    }
}
bash
php artisan vendor:publish --provider="Spatie\ActivityLog\ActivityLogServiceProvider" --tag="activitylog-migrations"
bash
php artisan migrate
bash
php artisan vendor:publish --provider="Spatie\ActivityLog\ActivityLogServiceProvider" --tag="config"
bash
php artisan vendor:publish --provider="Workup\\Nova\\ActivityLog\\ToolServiceProvider" --tag="config"