고요빛물결

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

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

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

 

 

 

 

 

댓글을 작성하시려면 로그인이 필요합니다.
+
분류 제목 글쓴이 날짜 조회
라라벨 19-01-09 조회 1,760
라라벨 19-01-08 조회 2,022
라라벨 19-01-08 조회 1,589
라라벨 19-01-08 조회 1,604
라라벨 19-01-07 조회 2,259
라라벨 19-01-06 조회 2,133
기타 19-01-05 조회 2,276
라라벨 19-01-04 조회 1,776
라라벨 19-01-04 조회 1,672
라라벨 19-01-04 조회 4,505
라라벨 19-01-03 조회 1,802
라라벨 19-01-03 조회 2,987
라라벨 19-01-02 조회 1,829
라라벨 19-01-01 조회 2,149
라라벨 18-12-31 조회 2,128
라라벨
[라라벨]
18-12-30 조회 1,605
라라벨 18-12-30 조회 2,601
기타 18-12-30 조회 1,571
라라벨 18-12-29 조회 1,947
코드이그나이터 18-12-28 조회 1,720
일반 18-12-28 조회 1,693
라라벨 18-12-27 조회 1,800
라라벨 18-12-26 조회 2,580
라라벨 18-12-25 조회 1,733
라라벨 18-12-23 조회 1,717
라라벨 18-12-20 조회 2,302
기타 18-10-07 조회 2,199
라라벨 18-10-05 조회 1,943
기타 18-10-04 조회 2,493
기타 18-10-03 조회 2,335