PHP code example of bbs-lab / nova-action-event-columns

1. Go to this page and download the library: Download bbs-lab/nova-action-event-columns 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/ */

    

bbs-lab / nova-action-event-columns example snippets


'actions' => [
    'resource' => \BBSLab\NovaActionEventColumns\Nova\ActionResource::class,
],

use BBSLab\NovaActionEventColumns\Facades\NovaActionEventColumns;
use Laravel\Nova\Fields\Number;

public function boot(): void
{
    NovaActionEventColumns::register(
        'tenant_id',
        fn ($request) => $request?->user()?->tenant_id,       // value resolver
        fn () => Number::make('Tenant', 'tenant_id')->exceptOnForms(), // optional Nova field
    );
}

// routes/console.php
Schedule::command('action-events:prune --days=365 --force')->daily();

->withMiddleware(function (Middleware $middleware) {
    $middleware->trustProxies(headers: Request::HEADER_X_FORWARDED_FOR);
})
bash
# Delete events older than 365 days (chunked)
php artisan action-events:prune --days=365

# Or by hours
php artisan action-events:prune --hours=48

# Wipe everything (TRUNCATE, resets the auto-increment)
php artisan action-events:prune --all

# Skip the production confirmation prompt
php artisan action-events:prune --days=365 --force