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

@@ -32,7 +32,7 @@ class ScheduleController extends AbstractApiController
*
* @return \Illuminate\Http\JsonResponse
*/
public function getSchedules()
public function index()
{
$schedule = Schedule::whereRaw('1 = 1');
@@ -54,7 +54,7 @@ class ScheduleController extends AbstractApiController
*
* @return \Illuminate\Http\JsonResponse
*/
public function getSchedule(Schedule $schedule)
public function show(Schedule $schedule)
{
return $this->item($schedule);
}
@@ -64,7 +64,7 @@ class ScheduleController extends AbstractApiController
*
* @return \Illuminate\Http\JsonResponse
*/
public function postSchedule()
public function store()
{
try {
$schedule = dispatch(new CreateScheduleCommand(
@@ -89,7 +89,7 @@ class ScheduleController extends AbstractApiController
*
* @return \Illuminate\Http\JsonResponse
*/
public function putSchedule(Schedule $schedule)
public function update(Schedule $schedule)
{
try {
$schedule = dispatch(new UpdateScheduleCommand(
@@ -115,7 +115,7 @@ class ScheduleController extends AbstractApiController
*
* @return \Illuminate\Http\JsonResponse
*/
public function deleteSchedule(Schedule $schedule)
public function destroy(Schedule $schedule)
{
try {
dispatch(new DeleteScheduleCommand($schedule));