ShawnMcCool/laravel-auto-presenter — pull request #30 by kirkbushell (2014-08-25 10:47:57+00:00)
Title: 2.x update - API support, field accessibility, test fixes and resolution (full pass)

As part of a new project, we require the need to use presenters that respond well to APIs, wiht some interesting requirements, that being - the ability to change the fields that are actually presented as part of the response.

For an example - a user may be logged in as an admin, and when fetching forums via the api, should have more information available to them than a regular forum user. These updates allow a presenter to specify the fields available upon the presenter.

In addition, presenters can now be used as part of a JSON response payload, by returning the presenter itself from the controller action.

What's really cool about the current functionality, is that because the getPresenter is now a method - logic to define which presenter to be returned based on user level is easily supported.