FormatController – Return results with JSON, CSV, HTML
Published on by Eric L. Barnes
Dan Harper created:
A Laravel Controller which allows you to display report data in multiple formats. For example, you may display a preview as HTML, and offer buttons to download as CSV and JSON.
![Eric L. Barnes photo](https://laravel-news.com/storage/profile-photos/YlkXwoKe1xHNPfmxXdAbBIeCqg9kFE7CtyKySeI1.jpg)
Eric is the creator of Laravel News and has been covering Laravel since 2012.