Firefly III: a personal finances manager
PHP accountingbudgetbudgetingbudgetscash-flowcashflowcredit-carddockerexpensesfinancefinancesfinanciallinuxmoneypaycheckpersonal-financephpphp7
Remove reference to guard from other bind support classes.
James Cole0f09a9db4d58
diff --git a/app/Support/Binder/AccountList.php b/app/Support/Binder/AccountList.phpindex 208b1488a7..78be7c6e38 100644--- a/app/Support/Binder/AccountList.php+++ b/app/Support/Binder/AccountList.php@@ -39,9 +39,9 @@ class AccountList implements BinderInterface** @return Collection*/- public static function routeBinder($guard, string $value, Route $route): Collection+ public static function routeBinder(string $value, Route $route): Collection{- if ($guard->check()) {+ if (auth()->check()) {$list = [];$incoming = explode(',', $value);foreach ($incoming as $entry) {@@ -53,7 +53,7 @@ class AccountList implements BinderInterface}/** @var \Illuminate\Support\Collection $collection */- $collection = $guard->user()->accounts()+ $collection = auth()->user()->accounts()->leftJoin('account_types', 'account_types.id', '=', 'accounts.account_type_id')->whereIn('accounts.id', $list)->get(['accounts.*']);diff --git a/app/Support/Binder/BinderInterface.php b/app/Support/Binder/BinderInterface.phpindex f16c1d9a0c..3488867ba1 100644--- a/app/Support/Binder/BinderInterface.php+++ b/app/Support/Binder/BinderInterface.php@@ -35,5 +35,5 @@ interface BinderInterface** @return mixed*/- public static function routeBinder($guard, string $value, Route $route);+ public static function routeBinder(string $value, Route $route);}diff --git a/app/Support/Binder/BudgetList.php b/app/Support/Binder/BudgetList.phpindex d5f442d84b..f02cd32765 100644--- a/app/Support/Binder/BudgetList.php+++ b/app/Support/Binder/BudgetList.php@@ -38,9 +38,9 @@ class BudgetList implements BinderInterface** @return Collection*/- public static function routeBinder($guard, string $value, Route $route): Collection+ public static function routeBinder(string $value, Route $route): Collection{- if ($guard->check()) {+ if (auth()->check()) {$list = [];$incoming = explode(',', $value);foreach ($incoming as $entry) {@@ -52,7 +52,7 @@ class BudgetList implements BinderInterface}/** @var \Illuminate\Support\Collection $collection */- $collection = $guard->user()->budgets()+ $collection = auth()->user()->budgets()->where('active', 1)->whereIn('id', $list)->get();diff --git a/app/Support/Binder/CategoryList.php b/app/Support/Binder/CategoryList.phpindex dfe38433e4..3ce93ce553 100644--- a/app/Support/Binder/CategoryList.php+++ b/app/Support/Binder/CategoryList.php@@ -38,9 +38,9 @@ class CategoryList implements BinderInterface** @return Collection*/- public static function routeBinder($guard, string $value, Route $route): Collection+ public static function routeBinder(string $value, Route $route): Collection{- if ($guard->check()) {+ if (auth()->check()) {$list = [];$incoming = explode(',', $value);foreach ($incoming as $entry) {@@ -52,7 +52,7 @@ class CategoryList implements BinderInterface}/** @var \Illuminate\Support\Collection $collection */- $collection = $guard->user()->categories()+ $collection = auth()->user()->categories()->whereIn('id', $list)->get();diff --git a/app/Support/Binder/CurrencyCode.php b/app/Support/Binder/CurrencyCode.phpindex 102087df43..988a296aac 100644--- a/app/Support/Binder/CurrencyCode.php+++ b/app/Support/Binder/CurrencyCode.php@@ -37,9 +37,9 @@ class CurrencyCode implements BinderInterface** @return TransactionCurrency*/- public static function routeBinder($guard, string $value, Route $route): TransactionCurrency+ public static function routeBinder(string $value, Route $route): TransactionCurrency{- if ($guard->check()) {+ if (auth()->check()) {$currency = TransactionCurrency::where('code', trim($value))->first();if (null !== $currency) {return $currency;diff --git a/app/Support/Binder/Date.php b/app/Support/Binder/Date.phpindex ce4fa4c96e..9d9cedfe03 100644--- a/app/Support/Binder/Date.php+++ b/app/Support/Binder/Date.php@@ -40,7 +40,7 @@ class Date implements BinderInterface** @return Carbon*/- public static function routeBinder($guard, string $value, Route $route): Carbon+ public static function routeBinder(string $value, Route $route): Carbon{/** @var FiscalHelperInterface $fiscalHelper */$fiscalHelper = app(FiscalHelperInterface::class);diff --git a/app/Support/Binder/JournalList.php b/app/Support/Binder/JournalList.phpindex ef4d67cca6..a0f89dfe79 100644--- a/app/Support/Binder/JournalList.php+++ b/app/Support/Binder/JournalList.php@@ -37,9 +37,9 @@ class JournalList implements BinderInterface** @return mixed*/- public static function routeBinder($guard, string $value, Route $route): Collection+ public static function routeBinder(string $value, Route $route): Collection{- if ($guard->check()) {+ if (auth()->check()) {$list = [];$incoming = explode(',', $value);foreach ($incoming as $entry) {@@ -51,7 +51,7 @@ class JournalList implements BinderInterface}/** @var \Illuminate\Support\Collection $collection */- $collection = $guard->user()->transactionJournals()+ $collection = auth()->user()->transactionJournals()->whereIn('transaction_journals.id', $list)->where('transaction_journals.completed', 1)->get(['transaction_journals.*']);diff --git a/app/Support/Binder/TagList.php b/app/Support/Binder/TagList.phpindex b3d8ef98a0..ced7578e00 100644--- a/app/Support/Binder/TagList.php+++ b/app/Support/Binder/TagList.php@@ -39,9 +39,9 @@ class TagList implements BinderInterface** @return Collection*/- public static function routeBinder($guard, string $value, Route $route): Collection+ public static function routeBinder(string $value, Route $route): Collection{- if ($guard->check()) {+ if (auth()->check()) {$list = [];$incoming = explode(',', $value);foreach ($incoming as $entry) {@@ -53,7 +53,7 @@ class TagList implements BinderInterface}/** @var TagRepositoryInterface $repository */$repository = app(TagRepositoryInterface::class);- $repository->setUser($guard->user());+ $repository->setUser(auth()->user());$allTags = $repository->get();$collection = $allTags->filter(diff --git a/app/Support/Binder/UnfinishedJournal.php b/app/Support/Binder/UnfinishedJournal.phpindex 703d26d156..abcc002eb7 100644--- a/app/Support/Binder/UnfinishedJournal.php+++ b/app/Support/Binder/UnfinishedJournal.php@@ -37,13 +37,13 @@ class UnfinishedJournal implements BinderInterface** @return TransactionJournal*/- public static function routeBinder($guard, string $value, Route $route): TransactionJournal+ public static function routeBinder(string $value, Route $route): TransactionJournal{- if ($guard->check()) {- $journal = $guard->user()->transactionJournals()->where('transaction_journals.id', $value)+ if (auth()->check()) {+ $journal = auth()->user()->transactionJournals()->where('transaction_journals.id', $value)->leftJoin('transaction_types', 'transaction_types.id', '=', 'transaction_journals.transaction_type_id')->where('completed', 0)- ->where('user_id', $guard->user()->id)->first(['transaction_journals.*']);+ ->where('user_id', auth()->user()->id)->first(['transaction_journals.*']);if (!is_null($journal)) {return $journal;}