Supercharge your AI agents with data from the web and beyond. Building the library for superintelligence. 🔥
TypeScript aiai-agentsai-crawlerai-scrapingai-searchcrawlerdata-extractionhtml-to-markdownllmmarkdownscraperscrapingweb-crawlerweb-dataweb-data-extractionweb-scraperweb-scrapingweb-searchwebscraping
docs(php-sdk): document Laravel AI SDK tools, bump to 1.9.0
Kris Oei9fe8f166e110
diff --git a/apps/php-sdk/CHANGELOG.md b/apps/php-sdk/CHANGELOG.mdindex a7bb660e7..541ee7c13 100644--- a/apps/php-sdk/CHANGELOG.md+++ b/apps/php-sdk/CHANGELOG.md@@ -5,6 +5,15 @@ All notable changes to the Firecrawl PHP SDK will be documented in this file.The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).+## [1.9.0] - 2026-07-10++### Added+- Laravel AI SDK integration: native tool classes `FirecrawlScrape`, `FirecrawlSearch`,+ `FirecrawlMap`, and `FirecrawlCrawl` in `Firecrawl\Laravel\Tools`, plus a+ `FirecrawlTools::all()` helper. Drop them into any `laravel/ai` agent's `tools()`+ array — API key and config are reused from the existing Laravel integration.+ Requires `laravel/ai ^0.9` (PHP 8.3+, Laravel 12+) in the consuming app.+## [1.3.0] - 2026-05-12### Addeddiff --git a/apps/php-sdk/README.md b/apps/php-sdk/README.mdindex 09c912de7..d47fa9d70 100644--- a/apps/php-sdk/README.md+++ b/apps/php-sdk/README.md@@ -387,6 +387,80 @@ class MyController}```+### Laravel AI SDK Tools++The SDK ships native tool classes for the [Laravel AI SDK](https://laravel.com/docs/ai-sdk)+(`laravel/ai`, requires PHP 8.3+ and Laravel 12+):++```bash+composer require laravel/ai+```++Add Firecrawl capabilities to any agent — no MCP server or manual HTTP calls needed.+The tools resolve the `FirecrawlClient` from the container, so your existing+`config/firecrawl.php` / `FIRECRAWL_API_KEY` setup is reused as-is:++```php+use Firecrawl\Laravel\Tools\FirecrawlScrape;+use Firecrawl\Laravel\Tools\FirecrawlSearch;+use Laravel\Ai\Contracts\Agent;+use Laravel\Ai\Contracts\HasTools;+use Laravel\Ai\Promptable;+use Stringable;++class ResearchAssistant implements Agent, HasTools+{+ use Promptable;++ public function instructions(): Stringable|string+ {+ return 'You are a research assistant. Use the Firecrawl tools to find and read web content.';+ }++ public function tools(): iterable+ {+ return [+ new FirecrawlScrape,+ new FirecrawlSearch,+ ];+ }+}++$response = ResearchAssistant::make()->prompt('What does firecrawl.dev do?');+```++Available tools:++| Class | Tool name | Wraps |+|---|---|---|+| `FirecrawlScrape` | `firecrawl_scrape` | Scrape one URL to markdown |+| `FirecrawlSearch` | `firecrawl_search` | Web search with JSON results |+| `FirecrawlMap` | `firecrawl_map` | Discover a site's URLs |+| `FirecrawlCrawl` | `firecrawl_crawl` | Crawl multiple pages to markdown |++Register all of them at once with the spread helper:++```php+use Firecrawl\Laravel\Tools\FirecrawlTools;++public function tools(): iterable+{+ return [...FirecrawlTools::all()];+}+```++Every tool also accepts an explicit client, for one-off credentials or use+outside the container:++```php+use Firecrawl\Client\FirecrawlClient;++new FirecrawlScrape(FirecrawlClient::create(apiKey: 'fc-other-key'));+```++Tool failures (rate limits, timeouts, invalid URLs) are returned to the model+as readable error strings rather than thrown, so agent runs degrade gracefully.+## LicenseMITdiff --git a/apps/php-sdk/src/Laravel/Tools/FirecrawlMap.php b/apps/php-sdk/src/Laravel/Tools/FirecrawlMap.phpindex 26884756c..c1271a9f3 100644--- a/apps/php-sdk/src/Laravel/Tools/FirecrawlMap.php+++ b/apps/php-sdk/src/Laravel/Tools/FirecrawlMap.php@@ -37,12 +37,12 @@ class FirecrawlMap extends FirecrawlTool),);- $links = array_values(array_map(static function (array $link): array {+ $links = array_map(static function (array $link): array {return array_filter(['url' => $link['url'] ?? null, 'title' => $link['title'] ?? null],static fn (mixed $value): bool => $value !== null,);- }, $map->getLinks()));+ }, $map->getLinks());if ($links === []) {return 'No URLs discovered.';diff --git a/apps/php-sdk/src/Version.php b/apps/php-sdk/src/Version.phpindex 2ce16e6a6..14feb9053 100644--- a/apps/php-sdk/src/Version.php+++ b/apps/php-sdk/src/Version.php@@ -6,5 +6,5 @@ namespace Firecrawl;final class Version{- public const SDK_VERSION = '1.8.0';+ public const SDK_VERSION = '1.9.0';}