PHPackages                             spekulatius/spatie-crawler-toolkit-for-laravel - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. spekulatius/spatie-crawler-toolkit-for-laravel

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

spekulatius/spatie-crawler-toolkit-for-laravel
==============================================

Handy classes for Spatie's crawler when using it with Laravel.

0.5.0(3y ago)209648[1 issues](https://github.com/spekulatius/spatie-crawler-toolkit-for-laravel/issues)MITPHPPHP ^7.2|^8.0

Since Nov 17Pushed 2y ago2 watchersCompare

[ Source](https://github.com/spekulatius/spatie-crawler-toolkit-for-laravel)[ Packagist](https://packagist.org/packages/spekulatius/spatie-crawler-toolkit-for-laravel)[ Fund](https://phpscraper.de/misc/sponsors.html)[ GitHub Sponsors](https://github.com/spekulatius)[ RSS](/packages/spekulatius-spatie-crawler-toolkit-for-laravel/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (3)Versions (10)Used By (0)

Spatie Crawler Toolkit for Laravel
==================================

[](#spatie-crawler-toolkit-for-laravel)

Laravel 9 should work, but is not extensively tested. Please report any issues you might find!
----------------------------------------------------------------------------------------------

[](#laravel-9-should-work-but-is-not-extensively-tested-please-report-any-issues-you-might-find)

[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Total Downloads](https://camo.githubusercontent.com/44ca3a974b2cf49bab02ecb886e31ae102c37d961e051c59948a87e6b1bd2d88/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7370656b756c61746975732f7370617469652d637261776c65722d746f6f6c6b69742d666f722d6c61726176656c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/spekulatius/spatie-crawler-toolkit-for-laravel) [![Awesome PHP crawler](https://camo.githubusercontent.com/9d49598b873146ec650fb3f275e8a532c765dabb1f61d5afa25be41e79891aa7/68747470733a2f2f617765736f6d652e72652f62616467652e737667)](https://github.com/spekulatius/awesome-php-scrapers-and-crawlers)

A set of classes to use [Spatie's crawler](https://github.com/spatie/crawler) with Laravel. Aim is to simplify building crawler applications or adding a crawler to an existing Laravel project. It can be conveniently integrated into [PHP Scraper](https://github.com/spekulatius/phpscraper), for example. At the moment the following helper classes are implemented:

Cache Crawl Queue
-----------------

[](#cache-crawl-queue)

The [CacheCrawlQueue](https://github.com/spekulatius/spatie-crawler-toolkit-for-laravel/blob/master/src/Queues/CacheCrawlQueue.php) allows use the pre-configured Cache in Laravel to store the queue. It stores any actions performed on the queue directly to avoid the need to manually store the queue. You can add it directly to your crawler:

```
Crawler::create()
    ->setCrawlQueue(new \Spekulatius\SpatieCrawlerToolkit\Queues\CacheCrawlQueue($url))
    ->startCrawling($url);
```

With this you can stop the crawl and restart at any time. This requires a cache-driver being configured in your `.env` file.

Crawl Logger
------------

[](#crawl-logger)

The [Crawl Logger](https://github.com/spekulatius/spatie-crawler-toolkit-for-laravel/blob/master/src/Observers/CrawlLogger.php) is an observer you can add to your crawler to enable logging of crawl events:

```
Crawler::create()
    ->setCrawlObserver(new \Spekulatius\SpatieCrawlerToolkit\Observers\CrawlLogger)
    ->startCrawling($url);
```

You can export the configuration (see below) to tweak which events are logged.

Crawl Events
------------

[](#crawl-events)

The toolkit contains an observer to send you Laravel events allowing you to react to crawl events. This covers the following events:

- [WillCrawl](https://github.com/spekulatius/spatie-crawler-toolkit-for-laravel/blob/master/src/Events/WillCrawl.php)
- [Crawled](https://github.com/spekulatius/spatie-crawler-toolkit-for-laravel/blob/master/src/Events/Crawled.php)
- [CrawlFailed](https://github.com/spekulatius/spatie-crawler-toolkit-for-laravel/blob/master/src/Events/CrawlFailed.php)
- [FinishedCrawling](https://github.com/spekulatius/spatie-crawler-toolkit-for-laravel/blob/master/src/Events/FinishedCrawling.php)

By default, no events are emitted. To enable events, you will need to add the event observer to your crawler:

```
$eventObserver = new \Spekulatius\SpatieCrawlerToolkit\Observers\CrawlEvents;

Crawler::create()
    ->setCrawlObserver($eventObserver)
    ->startCrawling($url);
```

An optional identifier can be passed to the crawl events to distinguish between different crawls:

```
$eventObserver = new \Spekulatius\SpatieCrawlerToolkit\Observers\CrawlEvents('my-crawl');
```

Planned functionality
---------------------

[](#planned-functionality)

- Batched crawling using Laravel Queues.

For any suggestions on how to enhance this, please raise an issue.

Requirements &amp; Install
--------------------------

[](#requirements--install)

### Requirements

[](#requirements)

- Laravel 6, 7, 8, 9. Laravel 9 is still in testing. Please report any issues.
- Cache and Log configured in Laravel.

### Installation

[](#installation)

```
composer require spekulatius/spatie-crawler-toolkit-for-laravel
```

Optionally, you can publish the configuration file:

```
php artisan vendor:publish --tag=crawler-toolkit-config
```

Contributing
------------

[](#contributing)

Please raise a PR or issue.

License
-------

[](#license)

Released under the MIT license. Please see [License File](LICENSE.md) for more information.

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity30

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 95.8% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~85 days

Recently: every ~167 days

Total

9

Last Release

1322d ago

PHP version history (2 changes)0.1.0PHP ^7.2

0.4.0PHP ^7.2|^8.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/8433587?v=4)[Peter Thaleikis](/maintainers/spekulatius)[@spekulatius](https://github.com/spekulatius)

---

Top Contributors

[![spekulatius](https://avatars.githubusercontent.com/u/8433587?v=4)](https://github.com/spekulatius "spekulatius (23 commits)")[![insign](https://avatars.githubusercontent.com/u/1113045?v=4)](https://github.com/insign "insign (1 commits)")

---

Tags

crawlerlaravellaravel-crawlerphp-crawlerphp-scraperspatie-crawler

### Embed Badge

![Health badge](/badges/spekulatius-spatie-crawler-toolkit-for-laravel/health.svg)

```
[![Health](https://phpackages.com/badges/spekulatius-spatie-crawler-toolkit-for-laravel/health.svg)](https://phpackages.com/packages/spekulatius-spatie-crawler-toolkit-for-laravel)
```

###  Alternatives

[wireui/wireui

TallStack components

1.8k1.3M16](/packages/wireui-wireui)[livewire/volt

An elegantly crafted functional API for Laravel Livewire.

4195.3M84](/packages/livewire-volt)[ramonrietdijk/livewire-tables

Dynamic tables for models with Laravel Livewire

21147.4k](/packages/ramonrietdijk-livewire-tables)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
