DO NOT RUN
composer require wonsong82/webpack
composer require wonsong82/laravel-DBController
INSTALLATION
composer install
php artisan vendor:publish --provider="Won\Webpack\WebpackServiceProvider" --force
edit package.json
npm install
sudo chgrp -R www-data storage
sudo chgrp -R www-data bootstrap/cache
sudo chmod -R ug+rwx storage
sudo chmod -R ug+rwx bootstrap/cache
INIT
php artisan module:vendor:patch
- Item, Products: ean-13(Korea, Europe, East Asia), upc-e(United States)
- Receiving Order, Palete, Box: code 128-B
- Descriptive name.
- snake_case type.
- snake_case type.
- Strictly follow laravel table structure & convention.
- ModelEntity -> model_entities (plural)
- One to One | One to Many -> parent_entity_childrens (singular_plural)
- Many to Many -> relation_relation (singular_singular)
- Include 'id', 'created_at', 'updated_at' (complete table structure)
- 'bold' for foreign key (ctrl+B)
- 'italic' for index (for multi index, please make a note) (ctrl+I)
- 'unique' for unique (for multi unique, please make a note) (ctrl+U)
- 'strike-through' for nullable (alt+shift+5)
- Any field that can contain multiple values, use 'Constant'.
- Field name must include _code at the end.
- Example
'Shipping Status' => 'shipping_status_code'
- Example
'Item Process Type' => 'item_process_type_code'
- Example
- List up all the constants into note
- Field name must include _code at the end.
- For anything else (like default value), make a note
- Primary key
- 'id' bigint unsigned increment
- DateTime
- '_at' datetime
- Date
- '_date' date
- Constants
- '_code' integer
- Boolean
- 'is_' boolean
- Price
- Decimal (22, 8)
- Cast for decimal must be setted
real
for type casting
- hyphen-case type.
- hyphen-case type.
- PascalCase type.
- camelCase
- Make branch from master
- Decide branch name with a team
php artisan module:generate ModuleName ModuleNumber
- Module name is PascalCase type.
- Assign number in migration orders.
- Example
Item cannot be assigned before Business because Item requires one or more tables from Business
- Example
- Module number is for migration order
- Decide Module number with a team
- Reference module structure from Company module
- After generating module, Add module to providers list in config/app.php
Module\Receiving\ModuleNameServiceProvider::class
- Provider method executing order is..
- register()
- boot()
php artisan module:make TestModule CrudController TestClass
- CrudController name is PascalCase type.
- Heading
traits:
CrudTrait
CustomCrudTrait
AddressCrudTrait
php artisan module:make TestModule Model TestModel
- CrudController name is PascalCase type.
- Input field which user can write on
$fillable
- Hasorder is using (Left Right Algorithm)
- Datetime type support Carbon library -> useful for date and time data handling
- Trait for CRUD must placed to bottom and others to top
- Heading
traits:
HasConstants
HasOrder
HasActivityLogs
HasModelChanges
HasPhones
HasAddresses
HasNotifications
scopeOrder
scopeSearch
php artisan module:make Test Event Test
- CrudController name is PascalCase type.
php artisan module:make Test Request Test
- CrudController name is PascalCase type.
php artisan module:make Test Constant Test
- CrudController name is PascalCase type.
- Field name must be ${var}_code
- Example
status -> status_code
- Example
- 200101 = 2:ModuleNumber, 1:Constant, 1:Value
- Add translation by Constant name in
Traslations/ko
-
$this->$ {var} will return object
php artisan module:make Test:LogicController Test
- CrudController name is PascalCase type.
- Add 'Create', 'Update', 'Delete' Method.
2018_01_01_000200_create_company_tables.php
- Ordered by module number and date
- Write both up and down function for
migrate:refresh
- Generals use: module::filename.fieldname
- Constants: module::constant.constant_key
- For crud list page, Use constant type (constant.blade.php)
- 코드 수정 후 php artisan tinker
- 키이름은 다른 모듈들 참조해서 동일하게 하거나 DB에 Constants 테이블에 가보면 생성되어있는데 그대로 사용
- 데이터베이스 접근 및 사용 시 로그액티비티 자세하게 기록 리스너에 추가
- For custom view using
@extends
@extends ('application::crud.custom.create')
- 커스텀 트레잇은 항상 추가 컴퍼니트레잇은 컴퍼니를 사용하는 데만
- 컬럼추가시에 type 필드 추가하면 typescasting 가능
- SerialCode
$dispatchesEvent = [ 'creating' => SerializedModelCreating::class, 'created' => SerializedModelCreated::class ]; public $serialCode = 'code';
popup
multi list
list