#Tips
#참고 : https://github.com/bundanining/Shopping-Cart-Solution-CodeIgniter
vscode와 Git의 대소문자 구분시키기
git config core.ignorecase false

# 1. CodeIgniter 4 Application Starter

`composer create-project codeigniter4/appstarter 프로젝트명`

## 2. Setup

php.ini에 extension=intl 필요
apache의 DocumentRoot "패키지명/public" 수정 후 restart 필요
Copy `env` to `.env` and tailor for your app, specifically the baseURL and any database settings.
.env 수정
CI_ENVIRONMENT = development

# 3. 필요한 추가 패키지

composer require saleh7/proxmox-ve_php_api

## 4. Running Development Server

php spark serve

## 5. Web접속

개발용 -> localhost:8080
실서버 -> https://proxmox.idcjp.jp

## 6. new Controller추가시 Config\Routes.php에 Routing설정 필요

$routes->get('/ProxmoxAPI', 'ProxmoxAPI::index');

## 7. composer.json의 "psr-4" 수정시 reload

"psr-4": {
"Tests\\Support\\": "tests/\_support"
"APP\\": "app"
}
composer dump-autoload

## 8. php spark 사용법 (https://onlinewebtutorblog.com/how-to-work-with-codeigniter-4-model-and-entity-tutorial/)

- User Table 관련
  php spark migrate:create create_user_table --> table 생성
  php spark migrate --> table 적용
  php spark make:migration update_and_addfield_to_users_table --> 기존 table 내용변경없이 column변경시
  php spark migrate:refresh --> table 수정후 재생성
  php spark migrate:rollback
  php spark migrate:status --> 상태보기

- 초기 데이터 넣기
  php spark make:seeder user --suffix
  php spark db:seed UsersSeeder

- mvc 생성 --suffix 추가필요
  php spark make:model user --suffix
  php spark make:controller user --suffix
  php spark make:entity user --suffix

- auth용
  php spark make:filter AuthGuard

## 9. Login관련 참조

https://www.jurisic.org/post/2022/11/28/How-to-make-simple-Authentication-with-CodeIgniter-4
