Download the PHP package infusionweb/laravel-robots-route without Composer
On this page you can find all versions of the php package infusionweb/laravel-robots-route. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download infusionweb/laravel-robots-route
More information about infusionweb/laravel-robots-route
Files in infusionweb/laravel-robots-route
Package laravel-robots-route
Short Description A route for serving a basic robots.txt in Laravel 5.1+, based on configuration settings.
License MIT
Homepage https://github.com/infusionweb/laravel-robots-route
Informations about the package laravel-robots-route
Laravel 5 robots.txt Route
A route for serving a basic robots.txt in Laravel 5.1+, based on configuration settings.
This is a fork of ellisthedev/laravel-5-robots, which was a fork of jayhealey/Robots, which was based on earlier work.
The purpose of this fork is to create a set-it-and-forget-it package that can be installed without much effort. It is therefore highly opinionated and not built for configuration.
When enabled, it allows access to all clients and serves up the sitemap.xml. Otherwise, it operates almost identically to Laravel's default configuration, denying access to all clients.
Installation
Step 1: Composer
Via Composer command line:
Or add the package to your composer.json
:
Step 2: Remove the existing robots.txt
Laravel ships with a default robots.txt which disallows all clients. It needs to be removed for the configured route to work.
Step 3: Enable the route
Add the service provider to your config/app.php
:
Publish the package config file:
You may now allow clients via robots.txt by editing the config/robots.php
file, opening up the site to search engines:
Or simply setting the the ROBOTS_ALLOW
environment variable to true, via the Laravel .env
file or hosting environment.
Credits
License
The MIT License (MIT). Please see License File for more information.