Requirements
- PHP 8.1 or later
ext-curlandext-jsonextensions (enabled by default in most PHP installations)- No runtime dependencies — zero third-party packages required
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Install the Law4Devs PHP SDK and make your first API call.
ext-curl and ext-json extensions (enabled by default in most PHP installations)composer require law4devs/law4devs
composer require law4devs/law4devs:^0.1
<?php
require_once 'vendor/autoload.php';
use Law4Devs\Client;
$client = new Client(apiKey: $_ENV['LAW4DEVS_API_KEY']);
$page = $client->frameworks->list();
echo $page->data[0]->name; // e.g. "Cyber Resilience Act"
use Law4Devs\Client;
$client = new Client(
apiKey: $_ENV['LAW4DEVS_API_KEY'],
baseUrl: 'https://api.law4devs.eu/v1', // default
timeout: 30, // seconds, default 30
maxRetries: 3, // retries on 429/5xx, default 3
);
| Option | Type | Default | Description |
|---|---|---|---|
apiKey | string | '' | Required. Your API key |
baseUrl | string | Production URL | Override for dev environment |
timeout | int | 30 | Request timeout in seconds |
maxRetries | int | 3 | Retries on 429/5xx |
export LAW4DEVS_API_KEY="your-key"
use Law4Devs\Client;
$client = new Client(apiKey: getenv('LAW4DEVS_API_KEY'));
LAW4DEVS_API_KEY=your-key php -r "
require 'vendor/autoload.php';
\$c = new \Law4Devs\Client(apiKey: getenv('LAW4DEVS_API_KEY'));
echo \$c->frameworks->list()->meta->total . ' frameworks\n';
"
Was this page helpful?
