So everything was going smooth, I made a new page, new fieldset for the collection, new collection itself, new entery into the collection and finally added the collections route.

Everything seemed to work just fine, the collection entries were showing properly and redirected to the correct URL. But then when I tried to go back to my home page, "Page not found". When I try to go to the control panel, "Whoops, looks like something went wrong." My site just broke :(

I emptied my routes.yaml file but the problem remains. Even when I reversed all the changes with Git, the problem still remains.

This happend to me twice now, first time I couldn't figure it out so a started over with a fresh Statamic installation. But the second time the problem came at the exact same time, after modifying the routes.yaml file.

Has anyone else had this problem? Does anyone have any suggestions on how to fix this?

This is what my logs say:

[2018-10-02 21:39:48] production.ERROR: Symfony\Component\Debug\Exception\FatalThrowableError: Call to a member function data() on null in /Users/Vincent/Code/Projects/Personal/vincentvandeursen.nl/statamic/core/Http/Controllers/PagesController.php:36

And after that there is a Stack trace of 68 lines, I couldn't really make sense of it.

Thanks in advance!

Answered by Vincent! Go to answer.