Skip to content
Permalink
Browse files

Added the ability to specify the relationship of the model.

  • Loading branch information...
andrey-helldar committed Jun 21, 2019
1 parent 02fb01b commit 2ee4bd1564cbe57d6023c8287a2d291ea73d929f
Showing with 608 additions and 257 deletions.
  1. +2 −2 README.md
  2. +1 −0 composer.json
  3. +601 −252 composer.lock
  4. +3 −2 src/Traits/Helpers.php
  5. +1 −1 src/config/sitemap.php
@@ -78,7 +78,7 @@ To configure the generation, you need to fill the `models` array in the `config/
'route_parameters' => [
'slug' => 'table_field_for_slug',
'foo' => 'table_field_for_foo',
'bar' => 'table_field_for_bar',
bar' => 'my_relation.slug',
'baz',
],
'lastmod' => 'updated_at',
@@ -93,7 +93,7 @@ As the key of the array, you must use the model name for which the rules will be
* **route** - the name of the route to generate the URL.
* **route_parameters** - the parameters to be passed to the URL generation method, where:
* the key is the parameter name for the routing. If the name of the routing parameter matches the name of the column in the database, you can specify only the value.
* the value is the name of the column in the database to substitute the value.
* the value is the name of the column in the database to substitute the value. If the value needs to be taken from the link, then you should specify the appeal through a point. For example: `'bar' => 'my_relation.slug'`.
* **lastmod** - is the name of the column containing the record date. In case of absence, the current date is used. If the model does not need to take into account the time field, set the parameter `lastmod` to `false`.
* **frequency** - is the value of the refresh rate of the content. This is necessary for some search robots. You can also use constants from `Helldar\Sitemap\Services\Sitemap` class.
* **priority** - is the priority of the reference for model records.
@@ -19,6 +19,7 @@
"ext-dom": "*",
"andrey-helldar/xml-core": "^1.0",
"illuminate/database": "^5.6",
"illuminate/support": "^5.6",
"nesbot/carbon": "^1.25 || ^2.0",
"symfony/http-foundation": "^4.0"
},

0 comments on commit 2ee4bd1

Please sign in to comment.
You can’t perform that action at this time.