https://larecipe.binarytorch.com.my/


LaRecipe는 소프트웨어 프로젝트에 Markdown을 사용하여 깨끗하고 아름다운 문서를 작성하고 문서를 소스 코드 내에 유지하도록 도와줍니다.



컴포저로 설치

composer require binarytorch/larecipe


구성요소 게시

php artisan larecipe:install



  1. Laravel Valet 사용 : yourdomain.test/docs.
  2. Laravel serve 사용 : http://127.0.0.1:8000/docs.


HP Fatal error:  Allowed memory size of 1610612736 bytes exhausted (tried to allocate 4096 bytes) in phar:///usr/local/bin/composer/src/Composer/DependencyResolver/Solver.php on line 223


Fatal error: Allowed memory size of 1610612736 bytes exhausted (tried to allocate 4096 bytes) in phar:///usr/local/bin/composer/src/Composer/DependencyResolver/Solver.php on line 223


Check https://getcomposer.org/doc/articles/troubleshooting.md#memory-limit-errors for more info on how to handle out of memory errors.Wonui-MacBookPro:blog wonhochoi$ valet restart


이런 오류가 뜬다


1
php -r "echo ini_get('memory_limit').PHP_EOL;"
cs


128M


composer clear-cache


composer update

 라라벨버전

php버전 

 8.x

7.3 이상 

 7.x

 7.25 이상

 6x

 7.2.0 이상

 5.6 ~ 5.8

 7.1.3 이상

 5.5

 7.0.0 이상



    Asset     Size   Chunks             Chunk Names

/js/app.js  596 KiB  /js/app  [emitted]  /js/app


ERROR in ./resources/css/app.css

Module build failed (from ./node_modules/css-loader/index.js):

ModuleBuildError: Module build failed (from ./node_modules/postcss-loader/src/index.js):

TypeError: getProcessedPlugins is not a function

    at /Users/wonhochoi/blog/node_modules/tailwindcss/lib/processTailwindFeatures.js:71:83

    at LazyResult.run (/Users/wonhochoi/blog/node_modules/postcss-loader/node_modules/postcss/lib/lazy-result.js:288:14)

    at LazyResult.asyncTick (/Users/wonhochoi/blog/node_modules/postcss-loader/node_modules/postcss/lib/lazy-result.js:212:26)

    at LazyResult.asyncTick (/Users/wonhochoi/blog/node_modules/postcss-loader/node_modules/postcss/lib/lazy-result.js:225:14)

    at /Users/wonhochoi/blog/node_modules/postcss-loader/node_modules/postcss/lib/lazy-result.js:254:14

    at new Promise (<anonymous>)

    at LazyResult.async (/Users/wonhochoi/blog/node_modules/postcss-loader/node_modules/postcss/lib/lazy-result.js:250:23)

    at LazyResult.then (/Users/wonhochoi/blog/node_modules/postcss-loader/node_modules/postcss/lib/lazy-result.js:131:17)

    at Promise.resolve.then.then (/Users/wonhochoi/blog/node_modules/postcss-loader/src/index.js:142:8)

    at process._tickCallback (internal/process/next_tick.js:68:7)

    at runLoaders (/Users/wonhochoi/blog/node_modules/webpack/lib/NormalModule.js:316:20)

    at /Users/wonhochoi/blog/node_modules/loader-runner/lib/LoaderRunner.js:367:11

    at /Users/wonhochoi/blog/node_modules/loader-runner/lib/LoaderRunner.js:233:18

    at context.callback (/Users/wonhochoi/blog/node_modules/loader-runner/lib/LoaderRunner.js:111:13)

    at Promise.resolve.then.then.catch (/Users/wonhochoi/blog/node_modules/postcss-loader/src/index.js:208:9)

    at process._tickCallback (internal/process/next_tick.js:68:7)

 @ ./resources/css/app.css


ERROR in ./resources/css/app.css (./node_modules/css-loader??ref--5-2!./node_modules/postcss-loader/src??postcss0!./resources/css/app.css)

Module build failed (from ./node_modules/postcss-loader/src/index.js):

TypeError: Object.entries(...).flatMap is not a function

    at flattenColorPalette (/Users/wonhochoi/blog/node_modules/tailwindcss/lib/util/flattenColorPalette.js:8:83)

    at /Users/wonhochoi/blog/node_modules/tailwindcss/lib/plugins/divideColor.js:27:53

    at plugins.forEach.plugin (/Users/wonhochoi/blog/node_modules/tailwindcss/lib/util/processPlugins.js:69:5)

    at Array.forEach (<anonymous>)

    at _default (/Users/wonhochoi/blog/node_modules/tailwindcss/lib/util/processPlugins.js:63:11)

    at /Users/wonhochoi/blog/node_modules/tailwindcss/lib/processTailwindFeatures.js:60:54

    at LazyResult.run (/Users/wonhochoi/blog/node_modules/postcss-loader/node_modules/postcss/lib/lazy-result.js:288:14)

    at LazyResult.asyncTick (/Users/wonhochoi/blog/node_modules/postcss-loader/node_modules/postcss/lib/lazy-result.js:212:26)

    at LazyResult.asyncTick (/Users/wonhochoi/blog/node_modules/postcss-loader/node_modules/postcss/lib/lazy-result.js:225:14)

    at /Users/wonhochoi/blog/node_modules/postcss-loader/node_modules/postcss/lib/lazy-result.js:254:14

    at new Promise (<anonymous>)

    at LazyResult.async (/Users/wonhochoi/blog/node_modules/postcss-loader/node_modules/postcss/lib/lazy-result.js:250:23)

    at LazyResult.then (/Users/wonhochoi/blog/node_modules/postcss-loader/node_modules/postcss/lib/lazy-result.js:131:17)

    at Promise.resolve.then.then (/Users/wonhochoi/blog/node_modules/postcss-loader/src/index.js:142:8)

 @ ./resources/css/app.css 2:14-142

npm ERR! code ELIFECYCLE

npm ERR! errno 2

npm ERR! @ development: `cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --config=node_modules/laravel-mix/setup/webpack.config.js`

npm ERR! Exit status 2

npm ERR! 

npm ERR! Failed at the @ development script.

npm ERR! This is probably not a problem with npm. There is likely additional logging output above.


npm ERR! A complete log of this run can be found in:

npm ERR!     /Users/wonhochoi/.npm/_logs/2020-11-30T19_29_06_154Z-debug.log

npm ERR! code ELIFECYCLE

npm ERR! errno 2

npm ERR! @ dev: `npm run development`

npm ERR! Exit status 2

npm ERR! 

npm ERR! Failed at the @ dev script.

npm ERR! This is probably not a problem with npm. There is likely additional logging output above.


npm ERR! A complete log of this run can be found in:

npm ERR!     /Users/wonhochoi/.npm/_logs/2020-11-30T19_29_06_176Z-debug.log




여기서 자꾸 에러가 되어서 컴파일에러가 발생했다.

node 버전이 v10.15.3


node  버전을 업그레이드하여 해결하였다. v14.15.1



       Asset      Size   Chunks             Chunk Names

/css/app.css  3.74 MiB  /js/app  [emitted]  /js/app

  /js/app.js   594 KiB  /js/app  [emitted]  /js/app





그래도 안된다면 PostCSS 7 호환성 빌드 참고하자

https://tailwindcss.com/docs/installation



package.json

{
"private": true,
"scripts": {
"dev": "npm run development",
"development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --config=node_modules/laravel-mix/setup/webpack.config.js",
"watch": "npm run development -- --watch",
"watch-poll": "npm run watch -- --watch-poll",
"hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --disable-host-check --config=node_modules/laravel-mix/setup/webpack.config.js",
"prod": "npm run production",
"production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --config=node_modules/laravel-mix/setup/webpack.config.js"
},
"devDependencies": {
"axios": "^0.19",
"cross-env": "^7.0",
"laravel-mix": "^6.0.0-beta.14",
"lodash": "^4.17.19",
"postcss": "^8.2.1",
"resolve-url-loader": "^3.1.0",
"vue-template-compiler": "^2.6.12"
},
"dependencies": {
"autoprefixer": "^9.8.6",
"tailwindcss": "npm:@tailwindcss/postcss7-compat@^2.0.1"
}
}




1. 네이버 개발자 센터에서 애플리케이션 등록으로 간다.

https://developers.naver.com/main/









1. 공공데이터포털에 회원가입을 하고 로그인을 해준다.

오픈API 로 이동한다.



2. 활용신청을 클릭한다.


3. 개발신청을 작성한다.


4. 신청완료


5. 활용을 선택한다.


6. 실행을 누른다.


7. 미리보기를 누르면 이렇게 나온다.

한시간 정도 지나야지 사용가능한 것 같다.

8. xml데이터를 json데이터로 변경시켜준다. 


사용할때 인증키를 넣어줘야한다.

public function index()
{
$popularMovies = Http::get('http://openapi.airkorea.or.kr/openapi/services/rest/ArpltnInforInqireSvc/서비스키');

$xml = simplexml_load_string($popularMovies);
$json = json_encode($xml);

$array = json_decode($json,TRUE);

// dd($array['body']['items']);
dd($array);
return view('index');

}


9. 이렇게 api 데이터를 활용해서 사용할 수 있다.


1. 영화 진흥 위원회 회원가입하기 

http://www.kobis.or.kr/kobisopenapi/homepg/main/main.do


2.key 발급받기 위해 어떤 정보의 제공을 받을 것인지 선택해야한다.

일별 박스오피스를 받아보자

아래에 요청 URL을 복사한다.



3.  key 를 발급받자



발급키가 보일 것이다.


4. 사용방법은 JSON을 사용한다.


http://www.kobis.or.kr/kobisopenapi/webservice/rest/boxoffice/searchDailyBoxOfficeList.json?key=430156241533f1d058c603178cc3ca0e&targetDt=20120101

 

5. config/services.php

'boxoffice' => [
'token' => env('KOBISDB_BOX_OFFICE_TOKEN'),
],



6. .env  (영화 진흥위원회 에서 발급받은 키값을 입력한다)

KOBISDB_BOX_OFFICE_TOKEN = 발급받은 키값입력


7. MovuesController.php 

public function index()
{
//박스오피스 가져오기
$popularMovies = Http::withToken(config('services.boxoffice.token'))
->get('http://www.kobis.or.kr/kobisopenapi/webservice/rest/boxoffice/searchDailyBoxOfficeList.json?key=430156241533f1d058c603178cc3ca0e&targetDt=20200101'.'&api_key='.config('services.boxoffice.token'))
->json()['boxOfficeResult']['dailyBoxOfficeList'];

dd($popularMovies);
return view('index');
}


8. 브라우저 확인


9. 응답구조에 영화이미지가 없다.. 아쉽다.....


1.  스캐폴딩 설치

1
composer require laravel/ui
cs


2. ui명령정보 확인

1
php artisan ui --help
cs


3. 다음 명령어로 ui 설치할 수  있음


부트스트랩 

1
php artisan ui bootstrap --auth
cs


VUE

1
php artisan ui vue --auth
cs


React

1
php artisan ui react --auth
cs


4. npm패키지 설치

1
npm install
cs


5. 컴파일

1
npm run dev
cs


+ Recent posts