Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/manchenkoff/breeze-api
Laravel Breeze API template application based on Sail
https://github.com/manchenkoff/breeze-api
api authentication breeze docker laravel sail sanctum
Last synced: about 2 months ago
JSON representation
Laravel Breeze API template application based on Sail
- Host: GitHub
- URL: https://github.com/manchenkoff/breeze-api
- Owner: manchenkoff
- License: mit
- Created: 2024-05-01T11:04:07.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2024-08-24T22:35:36.000Z (4 months ago)
- Last Synced: 2024-11-02T11:51:47.107Z (2 months ago)
- Topics: api, authentication, breeze, docker, laravel, sail, sanctum
- Language: PHP
- Homepage:
- Size: 158 KB
- Stars: 10
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# Laravel Breeze API template
This repository is a template for Laravel projects based on Sail environment to integrate with the Sanctum authentication.
You can use this project to integrate with one of these frontend applications:
- [Breeze Next](https://github.com/laravel/breeze-next/) (React/Next)
- [Breeze Nuxt](https://github.com/manchenkoff/breeze-nuxt) (Vue/Nuxt)## Prerequisites
To work with this project you will also need to install the following software:
- [Git](https://git-scm.com/)
- [Docker](https://docker.com/)
- [Taskfile](https://taskfile.dev/)## Features
- Laravel 11
- Breeze API with Sanctum
- Laravel Pint code formatter
- Larastan static analysis rules
- IDE helper for Laravel (Stubs generation)## Installation
1. Clone the repository:
```bash
git clone https://github.com/manchenkoff/breeze-api
```2. Build the project and install dependencies:
```bash
task build
```3. Start the project:
```bash
task start
```Once the project is started, you can access it at [http://localhost](http://localhost).
## Development
To get more details about available commands in `taskfile`, run the following command:
```bash
task -a
```To auto-format your code use `task fmt` command and also `task lint` to check the code quality by running Larastan checks.
## Production
**Environment**
To make sure that Laravel Sanctum will work on your production instance, make sure that you defined properly the following environment variables:
```dotenv
APP_KEY=base64:your_key_here # Generate a new key using `php artisan key:generate --show`
FRONTEND_URL=https://domain.com # Your frontend Nuxt application URL
SESSION_DOMAIN=.domain.com # Your domain should start with a dot to support all subdomains like www.* or frontend.*
```_💡 Keep in mind, that `SESSION_DOMAIN` is not applicable for `localhost` and should not be used during development with the value other than `null`._
**Multiple apps**
If you have multiple frontend applications (e.g. public and admin apps), you can define the `SANCTUM_STATEFUL_DOMAINS` environment variable to allow multiple domains to access the same session.
```dotenv
SANCTUM_STATEFUL_DOMAINS=domain.com,backoffice.domain.com,admin.domain.com
```