맨체스터 사는 개발자

[맨체스터개발자/PHP/Laravel8] Laravel UI 와 React 사용 본문

개발/PHP

[맨체스터개발자/PHP/Laravel8] Laravel UI 와 React 사용

aaamy91 2021. 5. 20. 06:58

Laravel 8 에서 제공하는? Authentication(Login & Register) 을 사용하려면 아래와 같이 실행해야 한다

1. jetstream 설치

composer require laravel/jetstream

2. jetstream을 사용하여 프로젝트 생성

laravel new {projectneme} --jet

3. migrate

php artisan migrate

그리고 http://127.0.0.1:8000/register 나 http://127.0.0.1:8000/login 에 접속하면 됨.

React 와 Laravel을 사용하고 싶다면 아래와 같이 실행해야함

1. NVM 설치

curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash
nvm -v 로 설치되었는지 확인

2. Nodejs 최신버전으로 업데이트 or 설치

nvm install node

 

 

laravel new test
cd test
composer require laravel/ui
php artisan ui react
만약 auth를 사용하고 싶다면
php artisan ui react --auth
npm install && npm run dev