Skip to content

Instantly share code, notes, and snippets.

@juanfvasquez
Last active December 3, 2017 16:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save juanfvasquez/050b8a8716de8b624c9130aff70aa210 to your computer and use it in GitHub Desktop.
Save juanfvasquez/050b8a8716de8b624c9130aff70aa210 to your computer and use it in GitHub Desktop.
Company Controller
'use strict'
const Company = use('App/Model/Company')
const Category = use('App/Model/Category')
* index(request, response) {
let companies = yield Company.with('categories').fetch()
yield response.sendView('companies', {companies: companies.toJSON()}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment