고요빛물결

[lavuebd]라라벨에 ERD 기준으로 model을 만들어 보죠

· 2019-01-08 (화) 03:14:58 · 1612

member는 laravel에 있는 user를 그냥 사용합니다.

php artisan make:model group -m

php artisan make:model board -m

php artisan make:model post -m

php artisan make:model comment -m

 

app/group.php app/board.php app/post.php 와

database/migrations/날짜_create_groups_table.php, create_boards_table.php, create_posts_table.php, create_comments_table.php

 

가 만들어진것을 확인 할수 있습니다.

 

왼쪽에서 creat_users_table.php를 클릭해서 (vscode 기준입니다.)

 

$table->string('name'); 을 alt+shift+down arrow로 라인을 카피한후에

name을 nickname으로 변경합니다.  각 테이블에 대한 Field는 여기 참조 

 

$table->increments('id');

$table->string('name');

$table->string('nickname');

$table->string('email')->unique();

$table->timestamp('email_verified_at')->nullable();

$table->string('password');

$table->rememberToken();

$table->timestamps();

 

groups

$table->increments('id');

$table->string('name');

$table->tinyinteger('order')

$table->timestamps();

 

boards

$table->increments('id');

$table->integer('group_id')->unsigned();

$table->string('name');

$table->string('mobile_name');

$table->tinyinteger('order');

$table->timestamps();

 

posts

$table->increments('id');

$table->integer('member_id')->unsigned();

$table->integer('board_id')->unsigned();

$table->string('title');

$table->mediumtext('content');

$table->string('username');

$table->string('nickname');

$table->timestamps();

 

comments

$table->increments('id');

$table->integer('member_id')->unsigned();

$table->integer('board_id')->unsigned();

$table->integer('post_id')->unsigned();

$table->mediumtext('content');

$table->string('username');

$table->string('nickname');

$table->timestamps();

 

 

 

 

 

댓글을 작성하시려면 로그인이 필요합니다.
+
분류 제목 글쓴이 날짜 조회
기타 18-10-02 조회 2,935
기타 18-09-30 조회 2,474
라라벨
[라라벨]
18-09-29 조회 3,062
라라벨 18-09-28 조회 2,027
라라벨 18-09-27 조회 7,349
기타 18-04-05 조회 2,479
라라벨 18-03-28 조회 2,873
라라벨
[라라벨]
18-03-26 조회 2,369
라라벨 18-03-25 조회 2,432
라라벨 18-03-25 조회 2,427
코드이그나이터 18-03-18 조회 3,446
라라벨 18-02-23 조회 2,102
라라벨 18-02-23 조회 2,132
기타 18-02-04 조회 2,303
라라벨 18-01-31 조회 2,314
라라벨 17-12-31 조회 2,486
기타 17-12-14 조회 2,319
일반
[일반]
17-12-13 조회 2,580
라라벨 17-11-28 조회 1,810
라라벨 17-11-23 조회 2,603
라라벨 17-11-23 조회 2,793
기타 17-11-22 조회 2,514
라라벨 17-11-21 조회 1,970
라라벨 17-11-19 조회 1,690
라라벨 17-11-17 조회 2,162
라라벨 17-11-16 조회 2,133
라라벨 17-11-15 조회 2,100
기타 17-11-14 조회 2,275
라라벨 17-11-14 조회 2,708
기타 17-11-12 조회 4,162