lemaur / laravel-image-sitemap
Sitemap with images
Fund package maintenance!
lemaur
Installs: 3 618
Dependents: 1
Suggesters: 0
Security: 0
Stars: 2
Watchers: 1
Forks: 0
Open Issues: 0
Requires
- php: ^8.0
- illuminate/contracts: ^8.0|^9.0
- spatie/laravel-package-tools: ^1.4.3
- spatie/laravel-sitemap: ^6.0|^6.1
- spatie/phpunit-snapshot-assertions: ^4.2
Requires (Dev)
- brianium/paratest: ^6.2
- nunomaduro/collision: ^5.3|^6.0
- orchestra/testbench: ^6.15|^7.0
- phpunit/phpunit: ^9.3
- spatie/laravel-ray: ^1.9
- vimeo/psalm: ^4.4
This package is auto-updated.
Last update: 2024-11-29 06:52:46 UTC
README
This package can generate a sitemap with images according to Google Specifications.
It's basically built on top of Spatie's laravel-sitemap. The reason why I create it, it's because Spatie doesn't plan to add this functionality to his own package (see here for more info).
Support Me
Hey folks,
Do you like this package? Do you find it useful and it fits well in your project?
I am glad to help you, and I would be so grateful if you considered supporting my work.
You can even choose 😃:
- You can sponsor me 😎 with a monthly subscription.
- You can buy me a coffee ☕ or a pizza 🍕 just for this package.
- You can plant trees 🌴. By using this link we will both receive 30 trees for free and the planet (and me) will thank you.
- You can "Star ⭐" this repository (it's free 😉).
Installation
You can install the package via composer:
composer require lemaur/laravel-image-sitemap
You can publish the config file with:
php artisan vendor:publish --provider="Lemaur\Sitemap\SitemapServiceProvider" --tag="laravel_image_sitemap-config"
Usage
You can refer directly to Spatie's laravel-sitemap documentation to which I've added the possibility to include images. See the example below.
use Carbon\Carbon; use Lemaur\Sitemap\Sitemap; use Lemaur\Sitemap\Tags\Image; use Lemaur\Sitemap\Tags\Url; Sitemap::create() ->add(Url::create('/home') ->setLastModificationDate(Carbon::yesterday()) ->setChangeFrequency(Url::CHANGE_FREQUENCY_YEARLY) ->setPriority(0.1) ->addImage('/url/to/images.jpg') ->addImage( Image::create('/url/to/another-image.jpg') ->setTitle('Image Title') ->setCaption('Image Alt Text') ->setGeoLocation('Image Geo Location') ->setLicense('https://url/to/the/license') )) ->add(...) ->writeToFile($path);
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.