Coding conventions/naming conventions

DB Rules

DB/Table Setup
Database character code UTF-8 (utf8mb4)
Collation order utf8mb4_general_ci
This column is required
column name type (e.g. of machine, goods, etc.)
id AUTO_INCREMENT
created_at datetime type (creation date and time)
updated_at datetime type (date and time of update)
deleted_at datetime type (date and time of deletion)
delete_flg integer type / initial value is 0 (delete flag)

※Do not use null as much as possible

Comment

・Comments must be entered on the label
・Comment, enter corresponding value if normalization is done

column name Comment
fast_name
last_name
birthday 誕生日
gender [0:男性 1:女性]
Unification rule

Column name”, “form name” and “php variable” must be the same.
If the column name is “enable_flg”, the form name should also be “enable_flg”.

naming rule

File Naming Conventions

Controller name: 1 word + what you want to do (max 2 words excluding controller)
Capitalize the first letter of the word (Lower CamelCase)

Example)customerController.php,customerPaymentController.php

View name: Files with the same meaning should be lined up in a row.
Put an underscore (_) between words. (Snake case)

Example)customer_insert.php,user.php,user_list.php
Method name of controller

Method name of controller
The method name of the controller: “action_●●” should be Lower CamelCase.

Example)action_InsertPerson…etc.
DB/Table naming convention

Put conjunctions in “master table”, “sub-tables”, and “definition table”.
Put an underscore (_) between words. (Snake case)

Example)Master table: mst_customer,mst_user…etc.
Example)Sub table: sub_claim,sub_payment…etc.
Example)Definition table: def_status,def…etc
DB/Table Naming Conventions

Column names should have an underscore (_) between words. (Snake case)

Constant and PHP Sessions

Capitalize words and join them with underscores (_).

Example)USER_INSERT_DATA,SYSTEM_DIR…etc.