Add function view inside PostsController.php