This commit is contained in:
James Cole
2019-09-15 08:48:51 +02:00
parent 595a90cb0a
commit ef85b1180f
4 changed files with 23 additions and 2 deletions

View File

@@ -43,8 +43,15 @@ class BudgetList implements BinderInterface
*/
public static function routeBinder(string $value, Route $route): Collection
{
//Log::debug(sprintf('Now in BudgetList::routeBinder("%s")', $value));
if (auth()->check()) {
if ('allBudgets' === $value) {
return auth()->user()->budgets()->where('active', 1)
->orderBy('order', 'ASC')
->orderBy('name', 'ASC')
->get();
}
$list = array_unique(array_map('\intval', explode(',', $value)));
// @codeCoverageIgnoreStart