Removed unneeded method injection

This commit is contained in:
Graham Campbell
2015-12-23 14:51:18 +00:00
parent 8bf9db6155
commit d4614d8162
6 changed files with 21 additions and 36 deletions

View File

@@ -20,7 +20,7 @@ use GrahamCampbell\Binput\Facades\Binput;
use Illuminate\Contracts\Auth\Guard;
use Illuminate\Database\QueryException;
use Illuminate\Foundation\Bus\DispatchesJobs;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Request;
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
class ComponentController extends AbstractApiController
@@ -30,20 +30,17 @@ class ComponentController extends AbstractApiController
/**
* Get all components.
*
* @param \Symfony\Component\HttpFoundation\Request $request
* @param \Illuminate\Contracts\Auth\Guard $auth
*
* @return \Illuminate\Http\JsonResponse
*/
public function getComponents(Request $request, Guard $auth)
public function getComponents()
{
if ($auth->check()) {
if (app(Guard::class)->check()) {
$components = Component::whereRaw('1 = 1');
} else {
$components = Component::enabled();
}
return $this->paginator($components->paginate(Binput::get('per_page', 20)), $request);
return $this->paginator($components->paginate(Binput::get('per_page', 20)), Request::instance());
}
/**