1. 이왕이면 쿼리실행횟수를 줄이는 코드를 생각하자. - with, whereIn과 같은. 2. 도메인이 달라지면 상속을 받아서 클래스를 만들도록 하자. - 만약 같은 데이터를 가져온다고 하더라도 쓰임이 다르다면 상속받아서 다른 부분을 클래스에서 구현하도록 하자. 3. 페이지네이트 까먹지 말자. 4. else는 이왕이면 사용하지 말자. - if만으로도 해결되는 것들은 많다. 5. validate도 까먹지 말자. 6. where사용시 DB의 데이터타입 맞춰주자. - 인덱싱 안탈때도 있으니까. 7. 노란줄은 모두 없애주자. 마법의 alt+enter가 있다. 8. 클래스단위로 작성하자. 코드의 재사용성이 매우 높아진다.

이번엔 윈도우가 아님. 저번 글과는 다름. 먼저 홈브류, php는 잘 깔려있다는 가정하에 시작함. 아 php -v 했을때 버전이 내 맘대로 안되어 있으면, > brew unlink php && brew link --force php@7.4 로 버전 지정 가능합니당. 여튼 이제 시작해보자. > pecl install xdebug 로 깔아주면 맨 마지막에 아래의 그림과 같이 출력이 될건데, 여기서 인스톨링 경로를 복사해두자. 그리고 php.ini를 찾아서, 나같은 경우는 브류로 깔아서 /opt/homebrew/etc/php/7.4에 php.ini가 있었다. 그리고 다음과 같이 추가해주자. 아까 복사한 경로의 파일을 zend_extension에 넣어주고 저장. 그리고 버전 찍어보면 디버그 잘 설치 되었당. 끝..

permission은 spatie에서 만든 ACL기능을 하도록 해준다. 코끼리쿤한테 물어보면 둘다 잘 대답해주는데, - permission https://packagist.org/packages/spatie/laravel-permission spatie/laravel-permission - Packagist README Associate users with permissions and roles Sponsor If you want to quickly add authentication and authorization to Laravel projects, feel free to check Auth0's Laravel SDK and free plan at https://auth0.com/developers. ..
create(); $role = Role::findOrCreate('superAdmin', 'admin'); $permission = Permission::findOrCreate('rwd', 'admin'); $role->hasPermissionTo($permission); $superAdminUser = $adminUser->assignRole($role); $this->assertEquals(true, $superAdminUser->hasRole('superAdmin', 'admin')); return $superAdminUser; } /** * @test */ public functi..

도커를 깔아주고 시작합니다!! 터미널에서 먼저 만들고자하는 이름의 파일을 생성해주고 .laradock은 만들고자하는 프로젝트 이름입니당! 그리고 파일의 내용은 아래의 스크립트로 채우자. laradock() { if [[ $1 == 'new' ]]; then if [[ -z "$2" ]]; then echo "Input your ProjectName" && exit -1 fi; BASE_PATH="$(eval echo ~$USER)/Desktop/code/$2" if [[ -d "$BASE_PATH" ]]; then echo "Same project already exists" && exit -2 fi; mkdir -p $BASE_PATH && cd $BASE_PATH mkdir ./Infra larave..
https://laradock.io/documentation/#install-rdkafka-extension-in-php-fpm Install RDKAFKA extension in php-fpm# 1 - Open the .env file 2 - Search for the PHP_FPM_INSTALL_RDKAFKA argument under the PHP-FPM container 3 - Set it to true 4 - Re-build the container docker-compose build php-fpm Install RDKAFKA extension in workspace# This is needed for ‘composer install’ if your dependencies require Kaf..

아씽!!! ㅠㅠㅠㅠㅠㅠㅠㅠ 삽질 ㅠㅠㅠㅠㅠㅠㅠㅠㅠ 오랜만에 도커 돌리고 환경 구축한거 들어갔는데, 그사이에 우리 회사 시스템이 믹스를 도입했단말이지? 근데 믹스 돌려달란 오류나서 프론트 환경 새로 잡아줘야겠지 싶어서 npm install 을 때렸는데, 이게 뭐시당가.... 오류를 뱉는다... ENOENT: no such file or directory 이런 오류...... 너란 오류..... 초면입니다? 검색 ㄲㄲㄲㄲㄲㄲ https://github.com/mapbox/node-sqlite3/issues/900 When 'npm install' > "ENOENT: no such file or directory, rename ..." · Issue #900 · mapbox/node-sqlite3 Still ..
git clone https://www.github.com/phpredis/phpredis.git cd phpredis phpize && ./configure && make && sudo make install extension=redis php.ini에 추가 vi /opt/homebrew/ect/php/7.4/php.ini 에서 변경 brew services restart php@7.4 composer install -vvv
- Total
- Today
- Yesterday
- twoseven.kr/0410
- 배열을_이쁘게
- 엘라스틱서치한글성공!
- 테스팅
- fmf
- 테스팅환경
- xml로도
- 프로그래밍은디버거부터시작이다
- twoserven.kr/0410
- UTF8
- gcp
- Testing
- JSON으로도
- PhpStorm
- 더미데이터도유형이있어요
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |