Laravel is an open-source PHP web development framework created by Taylor Otwell. Laravel helps you create applications using simple, expressive syntax.
4
votes
3answers
1k views
Controller method - Ajax request
I'm quite new to Laravel, and I'm not sure what am I doing is the best practice.
I'd like to return JSON if the request is Ajax, or return a view otherwise. This is the way I made it, and it works ...