mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Remove reference to guard from other bind support classes.
This commit is contained in:
parent
53a6c10ada
commit
0f09a9db4d
@ -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.*']);
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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();
|
||||
|
@ -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();
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
@ -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.*']);
|
||||
|
@ -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(
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user