_components = $components; $this->_accounts = $accounts; $this->_categories = $categories; $this->_budgets = $budgets; } /** * Returns a JSON list of all beneficiaries. */ public function beneficiaries() { $list = $this->_accounts->getBeneficiaries(); $return = []; foreach ($list as $entry) { $return[] = $entry->name; } return Response::json($return); } /** * Responds some JSON for typeahead fields. */ public function categories() { $list = $this->_categories->get(); $return = []; foreach ($list as $entry) { $return[] = $entry->name; } return Response::json($return); } }