Replies: 1 comment 1 reply
-
Feel free to PR this. This package might be another good candidate to make PHP 8 only, do a cleanup, and add features like this. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
It's likely that you want to add models like blog posts, products or similar to your sitemap.
The spatie RSS package has a
Feedable
interface for such cases. How about aSitemapable
interface which defines a methodgetSitemapltem()
in which you have to return an instance of a sitemap tag.This would allow to do
$sitemap->add($post)
and with another small adjustment would even allow to do$sitemap->add(Post::all())
.I think that the last one would be the biggest improvement as you can add all your posts, products ... in one line of code.
This would for sure also allow to add other classes implementing this interface - for example a custom sheet class from später sheet package.
Beta Was this translation helpful? Give feedback.
All reactions