Removed unneeded method injection
This commit is contained in:
@@ -19,7 +19,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 IncidentController extends AbstractApiController
|
||||
@@ -29,18 +29,15 @@ class IncidentController extends AbstractApiController
|
||||
/**
|
||||
* Get all incidents.
|
||||
*
|
||||
* @param \Symfony\Component\HttpFoundation\Request $request
|
||||
* @param \Illuminate\Contracts\Auth\Guard $auth
|
||||
*
|
||||
* @return \Illuminate\Http\JsonResponse
|
||||
*/
|
||||
public function getIncidents(Request $request, Guard $auth)
|
||||
public function getIncidents()
|
||||
{
|
||||
$incidentVisibility = $auth->check() ? 0 : 1;
|
||||
$incidentVisibility = app(Guard::class)->check() ? 0 : 1;
|
||||
|
||||
$incidents = Incident::where('visible', '>=', $incidentVisibility)->paginate(Binput::get('per_page', 20));
|
||||
|
||||
return $this->paginator($incidents, $request);
|
||||
return $this->paginator($incidents, Request::instance());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -58,11 +55,9 @@ class IncidentController extends AbstractApiController
|
||||
/**
|
||||
* Create a new incident.
|
||||
*
|
||||
* @param \Illuminate\Contracts\Auth\Guard $auth
|
||||
*
|
||||
* @return \Illuminate\Http\JsonResponse
|
||||
*/
|
||||
public function postIncidents(Guard $auth)
|
||||
public function postIncidents()
|
||||
{
|
||||
try {
|
||||
$incident = $this->dispatch(new ReportIncidentCommand(
|
||||
|
||||
Reference in New Issue
Block a user