_budgets = $budgets; $this->_repository = $repository; View::share('menu', 'budgets'); } /** * @return $this|\Illuminate\View\View */ public function create() { $periods = \Config::get('firefly.periods_to_text'); return View::make('budgets.create')->with('periods', $periods); } /** * @return $this|\Illuminate\View\View */ public function indexByBudget() { $budgets = $this->_repository->get(); $today = new Carbon; return View::make('budgets.indexByBudget')->with('budgets', $budgets)->with('today', $today); } /** * @return $this|\Illuminate\View\View * @throws Firefly\Exception\FireflyException */ public function indexByDate() { // get a list of dates by getting all repetitions: $set = $this->_repository->get(); $budgets = $this->_budgets->organizeByDate($set); return View::make('budgets.indexByDate')->with('budgets', $budgets); } /** * TODO actual view, actual content. * * @param $budgetId * * @return string */ public function show(Budget $budget) { return $budget->id; // /** @var \Budget $budget */ // $budget = $this->_budgets->find($budgetId); // // $list = $budget->transactionjournals()->get(); // $return = []; // /** @var \TransactionJournal $entry */ // foreach ($list as $entry) { // $month = $entry->date->format('F Y'); // $return[$month] = isset($return[$month]) ? $return[$month] : []; // $return[$month][] = $entry; // // } // $str = ''; // // foreach ($return as $month => $set) { // $str .= '