red-ray/index-prevention

此软件包允许在开发过程中防止网站被索引

1.0 2021-03-05 12:16 UTC

This package is not auto-updated.

Last update: 2024-09-29 06:25:43 UTC


README

发布资源

php artisan vendor:publish --provider="RedRay\IndexPrevention\RedRayIndexPreventionProvider"

设置.env变量

...
SHOULD_PREVENT_INDEX=true
...

将中间件添加到app/Http/Kernel.php

protected $middlewareGroups = [
        'web' => [
            ...
            \RedRay\IndexPrevention\Middleware\PreventContentIndex::class
            ...
        ],
    ];