PHPackages                             uocnv/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. uocnv/spatie-crawler-toolkit-for-laravel

ActiveLibrary

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

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

1.0(3y ago)034MITPHPPHP ^7.2|^8.0

Since Jun 28Pushed 3y agoCompare

[ Source](https://github.com/NguyenUoc98/spatie-crawler-toolkit-for-laravel)[ Packagist](https://packagist.org/packages/uocnv/spatie-crawler-toolkit-for-laravel)[ Fund](https://www.buymeacoffee.com/spekulatius)[ GitHub Sponsors](https://github.com/spekulatius)[ RSS](/packages/uocnv-spatie-crawler-toolkit-for-laravel/feed)WikiDiscussions master Synced 1mo ago

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

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

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

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

[](#php-8-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)

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. 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:

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

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

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

```
$event_observer = 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, or 8.
- 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

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 83.3% 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

Unknown

Total

1

Last Release

1414d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/480a0f4dde868ba2a563f89ac15e25d9fd1640e9c04360d39cf7eabe51aba74f?d=identicon)[uocnv](/maintainers/uocnv)

---

Top Contributors

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

### Embed Badge

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

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

###  Alternatives

[anourvalar/eloquent-serialize

Laravel Query Builder (Eloquent) serialization

11320.2M21](/packages/anourvalar-eloquent-serialize)[namu/wirechat

A Laravel Livewire messaging app for teams with private chats and group conversations.

54324.5k](/packages/namu-wirechat)[statamic-rad-pack/runway

Eloquently manage your database models in Statamic.

135192.6k5](/packages/statamic-rad-pack-runway)

PHPackages © 2026

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