PHP code example of uocnv / spatie-crawler-toolkit-for-laravel

1. Go to this page and download the library: Download uocnv/spatie-crawler-toolkit-for-laravel 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/ */

    

uocnv / spatie-crawler-toolkit-for-laravel example snippets


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

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

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

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

$event_observer = new \Spekulatius\SpatieCrawlerToolkit\Observers\CrawlEvents('my-crawl');
bash
php artisan vendor:publish --tag=crawler-toolkit-config