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

@@ -36,7 +36,7 @@ class IncidentUpdateController extends AbstractApiController
*
* @return \Illuminate\Http\JsonResponse
*/
public function getIncidentUpdates(Incident $incident)
public function index(Incident $incident)
{
$updates = IncidentUpdate::orderBy('created_at', 'desc');
@@ -59,7 +59,7 @@ class IncidentUpdateController extends AbstractApiController
*
* @return \Illuminate\Http\JsonResponse
*/
public function getIncidentUpdate(Incident $incident, IncidentUpdate $update)
public function show(Incident $incident, IncidentUpdate $update)
{
return $this->item($update);
}
@@ -71,7 +71,7 @@ class IncidentUpdateController extends AbstractApiController
*
* @return \Illuminate\Http\JsonResponse
*/
public function postIncidentUpdate(Incident $incident)
public function store(Incident $incident)
{
try {
$update = dispatch(new CreateIncidentUpdateCommand(
@@ -95,7 +95,7 @@ class IncidentUpdateController extends AbstractApiController
*
* @return \Illuminate\Http\JsonResponse
*/
public function putIncidentUpdate(Incident $incident, IncidentUpdate $update)
public function update(Incident $incident, IncidentUpdate $update)
{
try {
$update = dispatch(new UpdateIncidentUpdateCommand(
@@ -119,7 +119,7 @@ class IncidentUpdateController extends AbstractApiController
*
* @return \Illuminate\Http\JsonResponse
*/
public function deleteIncidentUpdate(Incident $incident, IncidentUpdate $update)
public function destroy(Incident $incident, IncidentUpdate $update)
{
try {
dispatch(new RemoveIncidentUpdateCommand($update));