{{ messages[0].message }}
Refactoring controllers with custom middleware
Ever wanted to do something before your controllers are called ? If you notice, some of the methods in our todo controller have to find the todo from the database before actually performing their supposed action. Let's clean this up using middleware.
{{ comment.user.name }} {{ comment.created_at }}
{{ comment.likes.length }}
{{ childComment.user.name }} {{ childComment.created_at }}
{{ childComment.likes.length }}