/laravel-react-authentication

An application / authentication starter kit frontend in React for Laravel Breeze.

Primary LanguagePHPMIT LicenseMIT

Laravel Breeze - React Edition

Inspiration 👌

This project was inspired by the Breeze Next.js project. 🏝️

Badges 🔖

MIT License GitHub repo size GitHub language count GitHub top language

Introduction 📑

This repository is an implementing of the Laravel Breeze application / authentication starter kit frontend in React. All of the authentication boilerplate is already written for you - powered by Laravel Sanctum, allowing you to quickly begin pairing your beautiful Rrrcat frontend with a powerful Laravel backend.

Documentation 📘

Installation 🔧

First, create a React compatible Laravel backend by installing Laravel Breeze into a fresh Laravel application and installing Breeze's API scaffolding:

# Create the Laravel application...
laravel new api-backend

cd api-backend

# Install Breeze and dependencies...
composer require laravel/breeze

php artisan breeze:install api

# Run database migrations
php artisan migrate

Next, ensure that your application's APP_URL and FRONTEND_URL environment variables are set to http://localhost:8000 and http://localhost:3000, respectively.

After defining the appropriate environment variables, you may serve the Laravel application using the serve Artisan command:

# Serve the application...
php artisan serve

Next, clone this repository and install its dependencies with yarn install or npm install. Then, copy the .env.example file to .env and supply the URL of your backend:

VITE_APP_NAME=Breeze React Api
VITE_PUBLIC_BACKEND_URL=http://localhost:8000

Finally, run the application via npm run dev. The application will be available at http://localhost:3000:

npm run dev

Note
Currently, is recommended use localhost during local development of your backend and frontend to avoid CORS "Same-Origin" issues.

License 📜

Laravel Breeze - React Edition is open-sourced software licensed under the MIT license.