Refactor post fetching for blade templates
Since #26 (closed) we have been able to use anonymous functions in blade templates to fetch posts by ID (all posts) or by their slug (published posts only).
However we are still primarily utilizing controller-bound fetchPost()
and fetchPostById()
when delivering contents to pages.
Why don't we just pass to our pages content IDs and let them handle it by themselves using $fetchPost()
and $fetchPostById()
from our AuthController?
Particularly when we are talking about:
- routes that utilizes
makeItem()
function. -
makePostList()
that sends both pagination object$posts
and deconstructed$postList
to blade view
Edited by Hendrik Lie