PHP code example of kerodev / filament-logger

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

    

kerodev / filament-logger example snippets


use Keroles\FilamentLogger\FilamentLoggerPlugin;

public function panel(Panel $panel): Panel
{
    return $panel
        ->plugins([
            FilamentLoggerPlugin::make(),
        ]);
}


 
namespace App\Providers;
 
use App\Policies\ActivityPolicy;
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
use Spatie\Activitylog\Models\Activity;
 
class AuthServiceProvider extends ServiceProvider
{
    protected $policies = [
        // Update `Activity::class` with the one defined in `config/activitylog.php`
        Activity::class => ActivityPolicy::class,
    ];
    //...
}

use Keroles\FilamentLogger\Contracts\AuthorizesActivityDeletion;

$this->app->singleton(AuthorizesActivityDeletion::class, function () {
    return new class implements AuthorizesActivityDeletion {
        public function canDelete(?\Illuminate\Contracts\Auth\Authenticatable $user): bool
        {
            return $user !== null && $user->can('deleteAny', \Spatie\Activitylog\Models\Activity::class);
        }
    };
});
bash
php artisan filament-logger:install
bash
php artisan vendor:publish --tag="filament-logger-translations"