/laravel-nextjs-breeze-api

an example of laravel breeze backend api for next js application

Primary LanguagePHP

Build Status Total Downloads Latest Stable Version License

About Laravel

Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experience to be truly fulfilling. Laravel takes the pain out of development by easing common tasks used in many web projects, such as:

Laravel is accessible, powerful, and provides tools required for large, robust applications.

Learning Laravel

Laravel has the most extensive and thorough documentation and video tutorial library of all modern web application frameworks, making it a breeze to get started with the framework.

If you don't feel like reading, Laracasts can help. Laracasts contains over 1500 video tutorials on a range of topics including Laravel, modern PHP, unit testing, and JavaScript. Boost your skills by digging into our comprehensive video library.

Laravel Sponsors

We would like to extend our thanks to the following sponsors for funding Laravel development. If you are interested in becoming a sponsor, please visit the Laravel Patreon page.

Premium Partners

Contributing

Thank you for considering contributing to the Laravel framework! The contribution guide can be found in the Laravel documentation.

Code of Conduct

In order to ensure that the Laravel community is welcoming to all, please review and abide by the Code of Conduct.

Security Vulnerabilities

If you discover a security vulnerability within Laravel, please send an e-mail to Taylor Otwell via taylor@laravel.com. All security vulnerabilities will be promptly addressed.

License

The Laravel framework is open-sourced software licensed under the MIT license.

Authors

🚀 About Me

I'm a full stack developer...

My interests range from data science to machine learning.love to work as a web Developer with new technology. Currently, studying Applied statistics and Data Science at Jahangirnagar University. System Analysis is one of my favourites. Learning Project management methodology and Documentation (Technical, Analytical) help me a lot to understand Software Usability Support and Technical Support. And last but not least I am a nature lover like Albert Einstein and one of my favourite Quote is "Look deep into nature, and then you will understand everything better".

here is my linkedin profile: https://www.linkedin.com/in/jahidulalammishuk/

Acknowledgements

Project Title

Laravel NextJS Backend with Breeze API

Demo

demo you are looking for :

Data set

this a dummy data set

create laravel project

So let's start from creating latest Laravel application. composer create-project Laravel/laravel laravel-breeze-api

Setup your .env file

.env

DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT=3306 DB_DATABASE=database_name DB_USERNAME=database_user_name DB_PASSWORD=database_password

Install breeze

composer require laravel/breeze --dev

Install breeze api

php artisan breeze:install api

After install breeze api, you can see .env file two url for backend and frontend. You can change url in production, for local leave it.

.env

APP_URL=http://localhost:8000 FRONTEND_URL=http://localhost:3000

run project and leave it.

php artisan serve

Note: Open two terminal one for run laravel application & second to create nextjs project and run.

Next js Frontend Setup For Breeze

Laravel Breeze authentication starter kit frontend in Next.js. All of the authentication boilerplate is already written for you - powered by Laravel Sanctum, allowing you to quickly begin pairing your beautiful Next.js frontend with a powerful Laravel backend.

You need to clone or download breeze-next

Clone breeze-next repository

run below command to clone repo. you can check repository link.

Install dependencies.

for node js

npm install or

for yarn

yarn install

Copy env file

cp .env.example .env

.env

you can change url in production.

NEXT_PUBLIC_BACKEND_URL=http://localhost:8000

run next js project

npm run dev next js run command

Nextjs register page

http://localhost:3000/register

nextjs sign up page

Nextjs login page

http://localhost:3000/login

nextjs login