PHPackages                             kazak71/laravel-robots - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. kazak71/laravel-robots

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

kazak71/laravel-robots
======================

Robots.txt generator service.

2.0.0(6y ago)03MITPHPPHP ^7.2.5

Since Oct 19Pushed 5y agoCompare

[ Source](https://github.com/kazak71/laravel-robots)[ Packagist](https://packagist.org/packages/kazak71/laravel-robots)[ Docs](https://github.com/mad-web/laravel-robots)[ RSS](/packages/kazak71-laravel-robots/feed)WikiDiscussions 2.1.1 Synced 2d ago

READMEChangelogDependencies (4)Versions (7)Used By (0)

Robots.txt generator service
============================

[](#robotstxt-generator-service)

[![Latest Version on Packagist](https://camo.githubusercontent.com/ecd7b48fb7f98e18b987e21ffa7228a910acef922b73cf33556de5f74894f4c4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d61642d7765622f6c61726176656c2d726f626f74732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/mad-web/laravel-robots)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/7a28021a644b5dd34e6f994fdd78fc31aee57f7b723638fb88663735c799e48e/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f6d61642d7765622f6c61726176656c2d726f626f74732f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/mad-web/laravel-robots)[![StyleCI](https://camo.githubusercontent.com/ae48fe649aed1be7eb8ccd69b6b16e653f45a065887af45ffa1b4877049cac6f/68747470733a2f2f7374796c6563692e696f2f7265706f732f3130373436333935312f736869656c64)](https://styleci.io/repos/107463951)[![Coverage Status](https://camo.githubusercontent.com/27e543dd44bc541b2a979c37465968f8c6930951c324559d4f00c22bf0ff7289/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f6d61642d7765622f6c61726176656c2d726f626f74732e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/mad-web/laravel-robots/code-structure)[![Quality Score](https://camo.githubusercontent.com/8126f23d1e2f649f9a48baaf33868551136587e50f04b14ea1ebd53e9c6a851d/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f6d61642d7765622f6c61726176656c2d726f626f74732e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/mad-web/laravel-robots)[![Total Downloads](https://camo.githubusercontent.com/6d0ba24258375dba94bf5bf70c0395958b23685662762e81b5b38d076f5111fa/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d61642d7765622f6c61726176656c2d726f626f74732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/mad-web/laravel-robots)

Nice Robots.txt generator service. For more information see [www.robotstxt.org](http://www.robotstxt.org)

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require mad-web/laravel-robots
```

Usage
-----

[](#usage)

Setting a condition in your `AppServiceProvider` that determines whether the site should be indexed.

```
use MadWeb\Robots\RobotsFacade;

public function boot()
{
    RobotsFacade::setShouldIndexCallback(function () {
        return app()->environment('production');
    });
    ...
}
```

You can create simple single action controller for generating robots.txt

**/routes/web.php**

```
Route::get('robots.txt', 'RobotsController');
```

**/app/Http/Controllers/Robots**

```
namespace App\Http\Controllers;

use MadWeb\Robots\Robots;
use App\Http\Controllers\Controller;

class RobotsController extends Controller
{
    /**
     * Generate robots.txt
     */
    public function __invoke(Robots $robots)
    {
        $robots->addUserAgent('*');

        if ($robots->shouldIndex()) {
            // If on the live server, serve a nice, welcoming robots.txt.
            $robots->addDisallow('/admin');
            $robots->addSitemap('sitemap.xml');
        } else {
            // If you're on any other server, tell everyone to go away.
            $robots->addDisallow('/');
        }

        return response($robots->generate(), 200, ['Content-Type' => 'text/plain']);
    }
}
```

Add robots meta tag into your view inside the `` tag

```

	{!! Robots::metaTag() !!}

```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

Testing
-------

[](#testing)

```
$ composer test
```

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) and [CONDUCT](CONDUCT.md) for details.

Security
--------

[](#security)

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

Credits
-------

[](#credits)

- [mad-web](https://github.com/mad-web)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 76.2% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~178 days

Total

7

Last Release

2061d ago

Major Versions

1.4.0 → 2.0.02020-03-04

PHP version history (3 changes)1.0PHP ^7.0

1.4.0PHP ^7.2

2.0.0PHP ^7.2.5

### Community

Maintainers

![](https://www.gravatar.com/avatar/020a81d47130d68099c5e7d8a0741d5f68b5597489b7cff1e5d28c6e840f8c0a?d=identicon)[kazak.71@gmail.com](/maintainers/kazak.71@gmail.com)

---

Top Contributors

[![jayhealey](https://avatars.githubusercontent.com/u/783447?v=4)](https://github.com/jayhealey "jayhealey (16 commits)")[![kazak71](https://avatars.githubusercontent.com/u/4598172?v=4)](https://github.com/kazak71 "kazak71 (4 commits)")[![bhuvidya](https://avatars.githubusercontent.com/u/455707?v=4)](https://github.com/bhuvidya "bhuvidya (1 commits)")

---

Tags

seorobotsmad-weblaravel-robots

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/kazak71-laravel-robots/health.svg)

```
[![Health](https://phpackages.com/badges/kazak71-laravel-robots/health.svg)](https://phpackages.com/packages/kazak71-laravel-robots)
```

###  Alternatives

[artesaos/seotools

SEO Tools for Laravel and Lumen

3.3k5.1M60](/packages/artesaos-seotools)[mad-web/laravel-robots

Robots.txt generator service.

33126.9k](/packages/mad-web-laravel-robots)[spatie/laravel-robots-middleware

Add an `all` or `none` robots header to your requests via a middleware in Laravel

3352.1M5](/packages/spatie-laravel-robots-middleware)[butschster/meta-tags

The most powerful and extendable tools for managing SEO Meta Tags in your Laravel project

628730.7k2](/packages/butschster-meta-tags)[mad-web/laravel-seoable

Easy to map your eloquent fields to seo properties

407.6k](/packages/mad-web-laravel-seoable)[calotype/seo

A package containing SEO helpers.

722.6k](/packages/calotype-seo)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
