Skip to content

Instantly share code, notes, and snippets.

@MarkBaker
Created December 2, 2016 00:49
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MarkBaker/7dd4bd939a0f3f4809970443fdc99cb0 to your computer and use it in GitHub Desktop.
Save MarkBaker/7dd4bd939a0f3f4809970443fdc99cb0 to your computer and use it in GitHub Desktop.
<?php
class evidenceController {
public function getDetails($id){
$course = Course::with(['courseType'])
->checkEstablishmentOnView()
->excludeArchived()
->findOrFail($id);
$view = View::make('courses/parts/details')
->with('course', $course);
return Response::json(['html' => $view->render()]);
}
}
@martinbean
Copy link

martinbean commented Dec 6, 2016

Returning a HTML blob in a JSON response?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment