Home / Controllers
Controllers should extend the Arc\Http\Controllers\BaseController class. This will give them access to the following
methods:
The abort method throws a HTTP exception which will be rendered by the exception handler:
$this->abort(401);
You may also provide the exception's response text:
$this->abort(401, 'Unauthorized.');Pass in an array of request parameters and an array of rules to generate an instance of Laravel's
Illuminate\Validation\Validator class. Calling this method is analogous to calling make() on Laravel's Validator facade.
The redirect method returns a redirect HTTP response, or returns the redirector instance if called with no arguments:
return $this->redirect('/home');
return $this->redirect()->route('route.name');return $this->response('Hello World', 200, $headers);
return $this->response()->json(['foo' => 'bar'], 200, $headers);The response method creates a response instance or obtains an instance of the response factory:
return $this->response('Hello World', 200, $headers);
return $this->response()->json(['foo' => 'bar'], 200, $headers);