Skip to content
This repository has been archived by the owner on Sep 12, 2022. It is now read-only.

Commit

Permalink
Added the ability to specify the relationship of the model.
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrey Helldar committed Jun 21, 2019
1 parent 02fb01b commit 2ee4bd1
Show file tree
Hide file tree
Showing 5 changed files with 608 additions and 257 deletions.
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -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',
Expand All @@ -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.
Expand Down
1 change: 1 addition & 0 deletions composer.json
Expand Up @@ -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"
},
Expand Down

0 comments on commit 2ee4bd1

Please sign in to comment.