Download the PHP package watson/sitemap without Composer

On this page you can find all versions of the php package watson/sitemap. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package sitemap

Sitemap for Laravel

Build Status Total Downloads Latest Stable Version Latest Unstable Version License

Sitemap is a package built specifically for Laravel that will help you generate XML sitemaps for Google. Based on laravel-sitemap this package operates in a slightly different way to better fit the needs of our project. A facade is used to access the sitemap class and we have added the ability to produce sitemap indexes as well as sitemaps. Furthermore, it's tested.

Read more about sitemaps and how to use them efficiently on Google Webmaster Tools.

Installation

Usage

Creating sitemap indexes

If you have a large number of links (50,000+) you will want to break your sitemaps out into seperate sitemaps with a sitemap index linking them all. You add sitemap indexes using Sitemap::addSitemap($location, $lastModified) and then you return the sitemap index with Sitemap::renderSitemapIndex(). The $lastModified variable will be parsed and converted to the right format for a sitemap.

Here is an example controller that produces a sitemap index.

Simply route to this as you usually would, Route::get('sitemap', 'SitemapsController@index');.

Creating sitemaps

Similarly to sitemap indexes, you just add tags for each item in your sitemap using Sitemap::addTag($location, $lastModified, $changeFrequency, $priority). You can return the sitemap with Sitemap::renderSitemap(). Again, the $lastModified variable will be parsed and convered to the right format for the sitemap.

If you'd like to just get the raw XML, simply call Sitemap::xml().

Here is an example controller that produces a sitemap for blog posts.

If you just want to pass a model's updated_at timestamp as the last modified parameter, you can simply pass the model as the second parameter and the sitemap will use that attribute automatically.

If you're pulling a lot of records from your database you might want to consider restricting the amount of data you're getting by using the select() method. You can also use the chunk() method to only load a certain number of records at any one time as to not run out of memory.

Image sitemaps

You can use Google image extensions for sitemaps to give Google more information about the images available on your pages. Read the specification

Images are associated with page and you can use up to 1000 images per page.

Here is an example of adding image tag to usual page tag.

Here is the full list of arguments to add an image to a tag.

Configuration

To publish the configuration file for the sitemap package, simply run this Artisan command:

Then take a look in config/sitemap.php to see what is available.

Caching

By default, caching is disabled. If you would like to enable caching, simply set cache_enabled in the configuration file to true. You can then specify how long you would like your views to be cached for. Keep in mind that when enabled, caching will affect each and every request made to the sitemap package.

Multilingual tags

If you'd like to use a mutlilingual tag, simply pass an instance of one to the addTag method. Below is a crude example of how you would pass alternate tag locations for different languages.


All versions of sitemap with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
illuminate/http Version ^8.0|^9.0|^10.0|^11.0
illuminate/support Version ^8.0|^9.0|^10.0|^11.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package watson/sitemap contains the following files

Loading the files please wait ....