Use Laravel Homestead's Vagrant Box to Tail Logs

Often times when developing using Laravel, I end up stuck on an error that seems to obfuscate the real problem with my code. Usually, it looks something like this: 

Now I don't know about you, but these types of error messages usually fail to reveal the actual problem and can sometimes even lead me in the wrong direction. Should the stack trace not reveal the error, I am often forced to fiddle with unrelated components, re-doing recent changes until I finally discover the error. 

Luckily, there is actually a simple solution to fix this problem if you are using Laravel's built in Homestead package. 

From the project's root directory, simply SSH into your vagrant box: 

vagrant ssh

Next, navigate to the logs folder and run the tail command. 

cd storage/logs 
tail -f laravel.log

Finally, try running the request again. Hopefully you will get a more verbose and detailed output the points you in the direction of the problem. Good luck and happy debugging!