Skip to content
Retrieves, validates, and parses remote sitemap documents
PHP
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src
tests
.gitignore
.travis.yml
LICENSE
composer.json
composer.lock
phpunit.xml
readme.md

readme.md

Retrieves, validates, and parses remote sitemap documents

Build Status Software License

Installation

composer require a3020/laravel-sitemap

Usage

Retrieve urls from a single sitemap

$client = $app->make('sitemap.client');
$urls = $client->get(['https://somedomain.com/sitemap.xml']);

Retrieve urls from sitemaps + sitemaps from robots.txt

$client = $app->make('sitemap.client');
$urls = $client->get(['https://somedomain.com/sitemap.xml'], 'https://somedomain.com/robots.txt');

Validate a sitemap

$validator = $app->make('sitemap.validator');
$validator->validate($contents);

Parse a sitemap

$parser = $app->make('sitemap.parser');

// Return URLs found in sitemap document
$parser->urls($contents);

// Filter to only get portfolio URLs.
$parser->filterUrlsByRegexes($contents, ['/portfolio']);
You can’t perform that action at this time.