Last active
December 3, 2017 16:07
-
-
Save juanfvasquez/050b8a8716de8b624c9130aff70aa210 to your computer and use it in GitHub Desktop.
Company Controller
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'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