mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-11-20 08:30:06 +00:00
Moved to high charts.
This commit is contained in:
40
app/controllers/JsonController.php
Normal file
40
app/controllers/JsonController.php
Normal file
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
use Firefly\Storage\Account\AccountRepositoryInterface as ARI;
|
||||
use Firefly\Storage\Component\ComponentRepositoryInterface as CRI;
|
||||
|
||||
class JsonController extends BaseController
|
||||
{
|
||||
|
||||
public function __construct(ARI $accounts,CRI $components)
|
||||
{
|
||||
$this->components = $components;
|
||||
$this->accounts = $accounts;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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->components->get();
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user