Hacker News new | past | comments | ask | show | jobs | submit login

> and it outputs a json serialized array as html

Actually, it renders a raw JSON response - a single object of 'unguarded' attributes (all by default) for the model with Content-Type: application/json set. It has nothing to do with HTML.

Your syntax is invalid too. To do what you want you'd actually call

    return Model::where('asdf', 1)->first();



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: