Add default files

This commit is contained in:
Dries Vints
2021-12-08 15:32:50 +01:00
parent 0b46190779
commit a07e11db81
14 changed files with 219 additions and 3 deletions

View File

@@ -1,10 +1,12 @@
## Laravel Breeze - Next.js Edition 🏝️
# Laravel Breeze - Next.js Edition 🏝️
## Introduction
This repository is an implementing of the [Laravel Breeze](https://laravel.com/docs/starter-kits) application / authentication starter kit frontend in [Next.js](https://nextjs.org). All of the authentication boilerplate is already written for you - powered by [Laravel Sanctum](https://laravel.com/docs/sanctum), allowing you to quickly begin pairing your beautiful Next.js frontend with a powerful Laravel backend.
#### Installation
## Official Documentation
### Installation
First, create a Next.js compatible Laravel backend by installing Laravel Breeze into a [fresh Laravel application](https://laravel.com/docs/installation) and installing Breeze's API scaffolding:
@@ -37,7 +39,7 @@ npm run dev
> Note: Currently, we recommend using `localhost` during local development of your backend and frontend to avoid CORS "Same-Origin" issues.
## Authentication Hook
### Authentication Hook
This Next.js application contains a custom `useAuth` React hook, designed to abstract all authentication logic away from your pages. In addition, the hook can be used to access the currently authenticated user:
@@ -58,3 +60,19 @@ export default ExamplePage
```
> Note: You will need to use [optional chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Optional_chaining) (`user?.name` instead of `user.name`) when accessing properties on the user object to account for Next.js's initial server-side render.
## Contributing
Thank you for considering contributing to Breeze Next! The contribution guide can be found in the [Laravel documentation](https://laravel.com/docs/contributions).
## Code of Conduct
In order to ensure that the Laravel community is welcoming to all, please review and abide by the [Code of Conduct](https://laravel.com/docs/contributions#code-of-conduct).
## Security Vulnerabilities
Please review [our security policy](https://github.com/laravel/breeze-next/security/policy) on how to report security vulnerabilities.
## License
Laravel Breeze Next is open-sourced software licensed under the [MIT license](LICENSE.md).