spatie / sheets

Store & retrieve your static content in plain text files
https://spatie.be/open-source
MIT License
273 stars 21 forks source link

add getBySlug() to FilesystemRepository.php #52

Closed Gummibeer closed 4 years ago

Gummibeer commented 4 years ago

closes #36

Gummibeer commented 4 years ago

Hey, just wanted to let you know that I'm no longer in need of this and because get() returns cached sheets by default now the all() method does also. My current approach now is to use all() followed by a custom first(Closure). Because of PHP7.4 short closures this is still pretty short and has much more options to customize. I'm using the date+slug pattern for example but only enforce unique slugs per year. Instead of this pretty limited method I would suggest to add a SheetCollection that allows the user to add custom macros or even rebind the class in its whole. This would allow the user to add much more customized logic to the collection. I will add an issue to discuss this in more detail.