Migrations

Naming

Most Controllers Should Correspond To A Model. Model_Name.php should have a corresponding controller ModelNameController.php.

Examples

  • Model.php, ModelController.php
  • User.php, UserController.php
  • Linklay_Custom_Pins.php, LinklayCustomPinsController.php

Functions

We try to keep our routes and controllers aligned with a RESTFUL design as much as possible. So in general the functions will be:

  • List() - List or Search the model
  • Get() - Get an individual model and the needed relations
  • Create() - POST to create model
  • Update() - PUT to update model
  • Delete() - DELETE

Function Standards

Controller functions should not have a lot of code. Their functionality should generally be encapsulated by functions in the model.

Form Requests

Generally each route / function should be protected by our Form Requests (which extends JsonFormRequest).

Create, Update, and Delete Routes absolutely must have Form Requests projecting them.

Naming

Naming of Form Requests should match that of Controllers: LinkLayCustomerPinsController.php, LinkLayCustomerPinsRequest.php