03.12.2015 Views

laravel4cookbook

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

API 128<br />

59 * @param int $id<br />

60 * @return Response<br />

61 */<br />

62 public function update($id)<br />

63 {<br />

64 //<br />

65 }<br />

66<br />

67 /**<br />

68 * Remove the specified resource from storage.<br />

69 *<br />

70 * @param int $id<br />

71 * @return Response<br />

72 */<br />

73 public function destroy($id)<br />

74 {<br />

75 //<br />

76 }<br />

77 }<br />

.<br />

This file should be saved as app/controllers/EventController.php.<br />

We’ve not going to be rendering views, so we can remove those statements/actions. We’re also not<br />

going to deal just with integer ID values (we’ll get to the alternative shortly).<br />

For now; what we want to do is list events, create them, update them and delete them. Our controller<br />

should look similar to the following:<br />

1

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!