Skip to content

Commit

Permalink
Update README.md (#499)
Browse files Browse the repository at this point in the history
modify Sitemapable example to include `setLastModificationDate` and so on...
  • Loading branch information
s-light authored Jun 27, 2023
1 parent eadf327 commit 63eb4fe
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ class Post extends Model implements Sitemapable
public function toSitemapTag(): Url | string | array
{
return route('blog.post.show', $this);
return Url::create(route('blog.post.show', $this))
->setLastModificationDate(Carbon::create($this->updated_at))
->setChangeFrequency(Url::CHANGE_FREQUENCY_YEARLY)
->setPriority(0.1);
}
}
```
Expand Down

0 comments on commit 63eb4fe

Please sign in to comment.