After adding the filter to /app/filters.php, the localhost page reloaded in my browser, I looked at a blog post and the 404 page, sidebar is still missing.
I looked for documentation to see what I’m missing but didn’t find much that was helpful. Does the filter need to be called somewhere? In a controller maybe?
So, as I just hinted, I then went to /views/index.blade.php, I see how the sidebar is added using different code.
When I applied this to either single.blade.php or 404.blade.php, the sidebar appears.
Am I missing some documentation to understand how to apply the sidebar filter example? Considering I could be interested in adding a sidebar to more than just posts and 404 pages, a filter makes more sense to have everything in one place. I appreciate your answers!
The sidebar filter is only relevant to Sage 9 (see the URL of the link you posted). Sage 10 does not use this filter and it will have no effect. In Sage 10 (as you’ve deduced) you show the sidebar by making use of the @section directive. Or however you want: The examples in the repo are only examples to illustrate how Blade works.
I appreciate the confirmation. I knew the link I posted above is to Sage 9 but I’m not able to find much documentation for the changes to Sage 10 outside of commit messages so it was time consuming to learn. Hopefully this filter will be removed from Sage 10 if it’s not used or needed any longer so others won’t be confused. Thanks again!