ตัวอย่าง Function มาตรฐานที่ควรมี เมื่อทำงานกับฐานข้อมูลที่เกี่ยวข้องกับ CRUD
<?phpnamespaceApp\Http\Controllers;useIlluminate\Http\Request;classFormControllerextendsController{publicfunctionindex() {// Read - Display a list of items }publicfunctioncreate() {// Create - Show the form to create a new item }publicfunctionstore(Request $request) {// Create - Save a new item to the database }publicfunctionshow($id) {// Read - Display a single item }publicfunctionedit($id) {// Update - Show the form to edit an item }publicfunctionupdate(Request $request, $id) {// Update - Save the edited item to the database }publicfunctiondestroy($id) {// Delete - Remove an item from the database }