Refactored the post controller, now you can delete the posts from index page
Now you can edit the posts
Refactored the post controller file