Remove reference to guard from other bind support classes.

This commit is contained in:
James Cole
2018-02-09 19:24:30 +01:00
parent 53a6c10ada
commit 0f09a9db4d
9 changed files with 23 additions and 23 deletions

View File

@@ -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.*']);