From Laravel 5.5, JSON responses are a little different. In particular, you’ll find that validation exceptions have changed, and it’s easy to miss what the upgrade guide says about it.
Since November 2017, I’ve been working with a small web-dev firm that uses Laravel for all its clients’ API backends. Over time, we’ve been taking new approaches to solving problems, and simplifying our code to make life easier in the long run. Here are some quick and useful tips we’ve been following as part of this process.
Shorter code is great. Even shorter code is even better. In this post, you’ll learn how to drastically shorten the length of your Vuex mutations, making for some really clean code.
It’s not uncommon to follow the default approach and register global Vue components manually. But there’s a better way. Two of them, in fact. And we can do it for Vuex too, but that’s for another post.
A cleaner way to validate console input.
Seriously, it’s overkill, and much of what goes on can be replaced with observable objects.
Making resource classes just a bit easier to work with.
Using helpers and scopes in a trait, make the model responsible for determining its resource class.
Browsers have caught up – developers should too.