Download the PHP package safaeean/laravel-sitemap without Composer

On this page you can find all versions of the php package safaeean/laravel-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 laravel-sitemap

Generate sitemaps with ease

Latest Version on Packagist Build Status Quality Score StyleCI Total Downloads

This package can generate a sitemap without you having to add urls to it manually. This works by crawling your entire site.

You can also create your sitemap manually:

Or you can have the best of both worlds by generating a sitemap and then adding more links to it:

Postcardware

You're free to use this package (it's MIT-licensed), but if it makes it to your production environment we highly appreciated you sending us postcard from your hometown, mentioning which of our package(s) you are using.

Our address is: safaeean, Samberstraat 69D, 2060 Antwerp, Belgium.

All postcards are published on our website.

Installation

First, install the package via composer:

Next up: installing the service provider

If you want to update your sitemap automatically and frequently you need to perform some extra steps.

Configuration

You can override the default options for the crawler. First publish the configuration:

This will copy the default config to config/sitemap.php where you can edit it.

Usage

Generating a sitemap

The easiest way is to crawl the given domain and generate a sitemap with all found links. The destination of the sitemap should be specified by $path.

The generated sitemap will look similiar to this:

Customizing the sitemap generator

Changing properties

To change the lastmod, changefreq and priority of the contact page:

Leaving out some links

If you don't want a crawled link to appear in the sitemap, just don't return it in the callable you pass to hasCrawled.

Preventing the crawler from crawling some pages

You can also instruct the underlying crawler to not crawl some pages by passing a callable to shouldCrawl.

Manually adding links

You can manually add links to a sitemap:

Adding alternates to links

Multilingual sites may have several alternate versions of the same page (one per language). Based on the previous example adding an alterante can be done as follows:

Note the function which takes an alternate URL and the locale it belongs to.

Manually creating a sitemap

You can also create a sitemap fully manual:

Creating a sitemap index

You can create a sitemap index:

You can pass a safaeean\Sitemap\Tags\Sitemap object to manually set the lastModificationDate property.

the generated sitemap index will look similar to this:

Generating the sitemap frequently

Your site will probably be updated from time to time. In order to let your sitemap reflect these changes you can run the generator periodically. The easiest way of doing this is do make use of Laravel's default scheduling capabilities.

You could setup an artisan command much like this one:

That command should then be scheduled in the console kernel.

Changelog

Please see CHANGELOG for more information what has changed recently.

Testing

First start the test server in a seperate terminal session:

With the server running you can execute the tests:

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Credits

About safaeean

safaeean is a webdesign agency based in Antwerp, Belgium. You'll find an overview of all our open source projects on our website.

License

The MIT License (MIT). Please see License File for more information.


All versions of laravel-sitemap with dependencies

PHP Build Version
Package Version
Requires php Version ^7.0
illuminate/support Version ~5.5.0|~5.6.0
nesbot/carbon Version ^1.21
spatie/crawler Version ^4.0.3
spatie/temporary-directory Version ^1.1
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 safaeean/laravel-sitemap contains the following files

Loading the files please wait ....