Due to a lot of refactoring, this version is not compatible with v1.
This package now supports Laravel's package auto-discovery. You can remove the line:
Gverschuur\RobotsTxt\RobotsTxtProvider::class
from your service providers in the config/app.php
file.
- If you included any files from the package yourself (by extending etc), change the namespace from
Gverschuur\RobotsTxt
toVerschuur\RobotsTxt
.
Due to the renaming of the namespace, there might be an error during installing due to conflicts. If this happens, first revote the provider from the app config file, then dump the autoloader and finally rerun the installation.
This version has a change to how the paths are defined in the config file. The v1 version was as follows:
paths -> {environment name} -> {robot name} -> {disallowed entries}
e.g.: paths -> production -> robot name -> Disallow all
This has been changed in v2. The order is now:
environments -> {environment name} -> paths -> {robot name} -> {disallowd/allow entries}
e.g.: environments -> production -> paths -> {robot name} -> Disallow all
For example, let's say your configuration is as follows:
'paths' => [
'production' => [
'bender' => [
''
],
'flexo' => [
'images'
]
],
'staging' => [
'*' => [
'/'
]
]
]
Then the new configuration would be:
'environments' => [
'production' => [
'paths' => [
'bender' => [
'disallow' => [
''
],
'allow' => []
],
'flexo' => [
'disallow' => [
'images'
],
'allow' => []
]
]
],
'staging' => [
'paths' => [
'*' => [
'disallow' => [
'/'
],
]
]
]
]