Rename controller methods following Laravel's resource controllers

This commit is contained in:
James Brooks
2017-07-26 08:31:11 -04:00
parent daeadc0e52
commit 85c10f1436
10 changed files with 116 additions and 106 deletions

View File

@@ -28,7 +28,7 @@ class IncidentController extends AbstractApiController
*
* @return \Illuminate\Http\JsonResponse
*/
public function getIncidents()
public function index()
{
$incidentVisibility = app(Guard::class)->check() ? 0 : 1;
@@ -54,7 +54,7 @@ class IncidentController extends AbstractApiController
*
* @return \Illuminate\Http\JsonResponse
*/
public function getIncident(Incident $incident)
public function show(Incident $incident)
{
return $this->item($incident);
}
@@ -64,7 +64,7 @@ class IncidentController extends AbstractApiController
*
* @return \Illuminate\Http\JsonResponse
*/
public function postIncidents()
public function store()
{
try {
$incident = dispatch(new CreateIncidentCommand(
@@ -95,7 +95,7 @@ class IncidentController extends AbstractApiController
*
* @return \Illuminate\Http\JsonResponse
*/
public function putIncident(Incident $incident)
public function update(Incident $incident)
{
try {
$incident = dispatch(new UpdateIncidentCommand(
@@ -126,7 +126,7 @@ class IncidentController extends AbstractApiController
*
* @return \Illuminate\Http\JsonResponse
*/
public function deleteIncident(Incident $incident)
public function destroy(Incident $incident)
{
dispatch(new RemoveIncidentCommand($incident));