고요빛물결

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

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

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();

 

 

 

 

 

댓글을 작성하시려면 로그인이 필요합니다.
+
분류 제목 글쓴이 날짜 조회
라라벨 17-11-11 조회 2,318
라라벨 17-11-10 조회 2,112
라라벨 17-11-07 조회 3,039
기타 17-10-31 조회 2,410
기타 17-10-30 조회 1,796
라라벨
[라라벨]
17-10-29 조회 1,911
기타 17-10-28 조회 2,304
기타 17-10-28 조회 1,908
라라벨 17-10-27 조회 3,598
기타 17-10-03 조회 3,149
기타 17-09-21 조회 2,219
라라벨 17-09-21 조회 2,434
라라벨 17-09-20 조회 2,485
라라벨 17-09-01 조회 2,428
라라벨
[라라벨]
17-06-30 조회 1,819
코드이그나이터 17-06-25 조회 2,912
코드이그나이터 17-06-23 조회 2,258
코드이그나이터 17-06-22 조회 2,873
라라벨 17-06-20 조회 3,312
일반 17-06-15 조회 1,972
일반 17-06-10 조회 2,400
기타 17-06-09 조회 2,742
라라벨 17-05-15 조회 1,811
라라벨 17-05-15 조회 1,834
라라벨 17-05-15 조회 1,919
기타 17-05-10 조회 1,955
기타 17-04-11 조회 2,110
라라벨 17-04-11 조회 2,562
라라벨 17-04-11 조회 1,856
기타 17-04-10 조회 2,156