PHP code example of padosoft / laravel-patent-box-tracker
1. Go to this page and download the library: Download padosoft/laravel-patent-box-tracker 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/ */
padosoft / laravel-patent-box-tracker example snippets
use Padosoft\PatentBoxTracker\PatentBoxTracker;
$session = PatentBoxTracker::for([
'/path/to/askmydocs',
'/path/to/laravel-ai-regolo',
'/path/to/laravel-flow',
])
->coveringPeriod('2026-01-01', '2026-12-31')
->classifiedBy('regolo')
->withTaxIdentity([
'denomination' => 'Padosoft di Lorenzo Padovani',
'p_iva' => 'IT01234567890',
'fiscal_year' => '2026',
'regime' => 'documentazione_idonea',
])
->withCostModel([
'hourly_rate_eur' => 80,
'daily_hours_max' => 8,
])
->run();
// $session is a TrackingSession Eloquent model with relations to TrackedCommit / TrackedEvidence.
use Padosoft\PatentBoxTracker\Hash\HashChainBuilder;
$verified = HashChainBuilder::verify($session);
if (! $verified->isValid()) {
throw new RuntimeException(
"Tamper detected at commit {$verified->brokenAt} — chain breaks at this row."
);
}
use Padosoft\PatentBoxTracker\Sources\EvidenceCollector;
final class CalendarCollector implements EvidenceCollector
{
public function supports(string $kind): bool
{
return $kind === 'calendar';
}
public function collect(array $context): array
{
// Walk Google Calendar / Outlook events, return Evidence DTOs.
return [];
}
}
// Register in a service provider:
$this->app->tag([CalendarCollector::class], 'patent-box.collectors');
// config/patent-box-tracker.php
'api' => [
'enabled' => true,
'prefix' => 'api/patent-box',
'middleware' => ['api'], // or ['api', 'auth:sanctum'] etc.
'rate_limiter' => '60,1', // 60 hits per minute per IP/user
'auth_token' => env('PATENT_BOX_API_TOKEN'), // optional bearer/header gate
],