Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Laravel Sitemap Laravel Package

spatie/laravel-sitemap

Generate XML sitemaps for Laravel by crawling your site or building them manually. Add extra URLs, set last-modified dates, and include models via a simple interface. Write sitemaps to disk with a fluent, developer-friendly API.

View on GitHub
Deep Wiki
Context7

title: Videos weight: 3

URLs can have video metadata. See the Google Video Sitemaps documentation for more information.

You can set the required attributes like so:

use Spatie\Sitemap\Sitemap;
use Spatie\Sitemap\Tags\Url;

Sitemap::create()
    ->add(
        Url::create('https://example.com')
            ->addVideo(
                'https://example.com/images/thumbnail.jpg',
                'Video title',
                'Video Description',
                'https://example.com/videos/source.mp4',
                'https://example.com/video/123',
            )
    )
    ->writeToFile($sitemapPath);

If you want to pass the optional parameters like family_friendly, live, platform, or tags:

use Spatie\Sitemap\Sitemap;
use Spatie\Sitemap\Tags\Url;
use Spatie\Sitemap\Tags\Video;

$options = ['family_friendly' => Video::OPTION_YES, 'live' => Video::OPTION_NO];
$allowOptions = ['platform' => Video::OPTION_PLATFORM_MOBILE];
$denyOptions = ['restriction' => 'CA'];
$tags = ['cooking', 'recipes'];

Sitemap::create()
    ->add(
        Url::create('https://example.com')
            ->addVideo(
                'https://example.com/images/thumbnail.jpg',
                'Video title',
                'Video Description',
                'https://example.com/videos/source.mp4',
                'https://example.com/video/123',
                $options,
                $allowOptions,
                $denyOptions,
                $tags,
            )
    )
    ->writeToFile($sitemapPath);
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
codraw/framework-extra-bundle
codraw/messenger
codraw/security
codraw/mailer
codraw/contracts
codraw/profiling
codraw/dependency-injection
codraw/tester
codraw/core
nexmo/api-specification
capell-app/block-library
axium/identity
cetria/laravel-dummy-models
cetria/reflection-helper
agropredict/sso-auth-bundle
evolvestudio/spam-protection
datacore/hub-sdk
develia/commons
cuci/prototurk-sdk
cuci/prototurk-sdk-symfony