PHP code example of softartisan / laravel-model-audits
1. Go to this page and download the library: Download softartisan/laravel-model-audits 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/ */
softartisan / laravel-model-audits example snippets
use Illuminate\Database\Eloquent\Model;
use SoftArtisan\LaravelModelAudits\Concerns\IsAuditable;
class Post extends Model
{
use IsAuditable;
protected $fillable = ['title', 'content', 'secret_token'];
}
protected function schedule(Schedule $schedule): void
{
$schedule->command('model:prune')->daily();
}
use SoftArtisan\LaravelModelAudits\Integrations\Mcp\ModelAuditsServer;
use Illuminate\Support\Facades\Mcp;
// Web transport (HTTP)
Mcp::server('model-audits', ModelAuditsServer::class);
// Local transport (STDIO)
Mcp::local('model-audits', ModelAuditsServer::class);