added the construct method to require authentication for creating or modifying posts