The "oh no she didn't" approach to building an API in Laravel is to simply return the result of an Eloquent query from your controller. Sure, Laravel is smart enough to cast this to JSON, but are you sure that's what you want to do? Let's talk about that.
Published on Nov 11th, 2015.
Understand.io is used by hundreds of Laravel developers to find and fix errors.
Sign up for a free 14-day trial now.