feat: Add DocumentSeeder with initial documents

- Add DocumentSeeder with Home, Getting Started, and Markdown Guide
- Update DatabaseSeeder to call UserSeeder and DocumentSeeder
- Update UserSeeder to set is_admin flag
- Update README with seeder documentation
This commit is contained in:
2025-11-29 11:40:08 +09:00
parent 691ac566e2
commit ecfa21d56c
4 changed files with 293 additions and 12 deletions

View File

@@ -112,8 +112,18 @@ docker exec kb_php npm run build
# マイグレーション
docker exec kb_php php artisan migrate
# 初期ユーザーの作成(オプション
# 初期データの投入(管理者ユーザー + 初期ドキュメント
docker exec kb_php php artisan db:seed
```
個別にシーダーを実行する場合:
```bash
# 管理者ユーザーのみ
docker exec kb_php php artisan db:seed --class=UserSeeder
# 初期ドキュメントのみ
docker exec kb_php php artisan db:seed --class=DocumentSeeder
```
### 6. 管理者の設定
@@ -134,11 +144,26 @@ docker exec kb_php php artisan user:set-admin admin@example.com --remove
| phpMyAdmin | http://localhost:9701 |
| MailHog | http://localhost:9725 |
## 初期アカウント
## 初期データ
### 初期アカウント
UserSeederを実行した場合
- **Email**: admin@example.com
- **Password**: password
- **権限**: 管理者
### 初期ドキュメント
DocumentSeederを実行すると以下のドキュメントが作成されます
| ドキュメント | 内容 |
|------------|------|
| Home | ホームページ(ウェルカムメッセージ、機能紹介) |
| Getting Started | 使い方ガイドドキュメント作成、Wikiリンク、ショートカット |
| Markdown Guide | Markdown記法ガイド見出し、リスト、コード、テーブル等 |
※ 既存のドキュメントがある場合、DocumentSeederはスキップされます。
## よく使うコマンド