고요빛물결

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

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

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-02-20 조회 1,664
기타 17-02-19 조회 2,103
라라벨 17-02-15 조회 1,806
일반 17-02-15 조회 1,827
일반 17-02-14 조회 3,467
기타 17-02-14 조회 3,108
기타
[기타]
17-02-14 조회 1,548
기타
[기타]
17-02-14 조회 2,412
라라벨 17-02-13 조회 2,077
라라벨
[라라벨]
17-02-13 조회 2,200
라라벨 17-02-13 조회 3,396
라라벨 17-02-12 조회 5,065
라라벨 17-02-12 조회 1,682
라라벨 17-02-11 조회 4,826
라라벨 17-02-11 조회 2,350
라라벨 17-02-10 조회 2,059
라라벨 17-02-10 조회 2,757
라라벨
[라라벨]
17-02-07 조회 1,932
라라벨 17-02-05 조회 2,489
라라벨 17-02-05 조회 2,588
라라벨 17-02-04 조회 2,146
라라벨 17-02-04 조회 1,840
기타 17-02-02 조회 1,731
일반 17-02-02 조회 1,756
기타 17-02-01 조회 4,674
기타 17-02-01 조회 2,444
기타 17-02-01 조회 2,595
공지 17-01-31 조회 1,808
기타 17-01-31 조회 4,192
일반 17-01-31 조회 1,520