Skip to content

Commit b5c988b

Browse files
committed
sail docs
1 parent 7652621 commit b5c988b

File tree

1 file changed

+48
-11
lines changed

1 file changed

+48
-11
lines changed

README.md

Lines changed: 48 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ The goal of the project is to create a template for development on Laravel and N
1515
- [Features](#features)
1616
- [Requirements](#requirements)
1717
- [Installation](#installation)
18+
- [Standalone](#standalone)
19+
- [Docker Deploy (Laravel Sail)](#docker-deploy-laravel-sail)
1820
- [Upgrade](#upgrade)
1921
- [Usage](#usage)
2022
- [Nuxt $fetch](#nuxt-fetch)
@@ -36,6 +38,7 @@ The goal of the project is to create a template for development on Laravel and N
3638
- [**Laravel Telescope**](https://laravel.com/docs/11.x/telescope) provides insight into the requests coming into your application, exceptions, log entries, database queries, queued jobs, mail, notifications, cache operations, scheduled tasks, variable dumps, and more.
3739
- [**Laravel Sanctum**](https://laravel.com/docs/11.x/sanctum) Token-based authorization is compatible with **SSR** and **CSR**
3840
- [**Laravel Socialite**](https://laravel.com/docs/11.x/socialite) OAuth providers
41+
- [**Laravel Sail**](https://laravel.com/docs/11.x/sail) Light-weight command-line interface for interacting with Laravel's default Docker development environment.
3942
- [**Spatie Laravel Permissions**](https://spatie.be/docs/laravel-permission/v6/introduction) This package allows you to manage user permissions and roles in a database.
4043
- UI library [**Nuxt UI**](https://ui.nuxt.com/) based on [**TailwindCSS**](https://tailwindui.com/) and [**HeadlessUI**](https://headlessui.com/).
4144
- [**Pinia**](https://pinia.vuejs.org/ssr/nuxt.html) The intuitive store for Vue.js
@@ -52,19 +55,53 @@ use $**fetch** without having to resort to custom $**fetch** wrappers.
5255
- [**Laravel Octane**](https://laravel.com/docs/11.x/octane) supports 2 operating modes: Swoole (php extension) or Roadrunner
5356

5457
## Installation
55-
1. clone repository
56-
2. `composer install`
57-
3. `cp .env.example .env && php artisan key:generate && php artisan storage:link`
58-
4. `php artisan migrate`
59-
5. `php artisan db:seed`
60-
6. `php artisan octane:install`
61-
7. `php artisan octane:start --watch --port=8000 --host=127.0.0.1`
62-
8. `yarn install`
63-
9. `yarn dev`
58+
### Standalone
59+
1. `composer install && yarn install`
60+
2. `cp .env.example .env && php artisan key:generate && php artisan storage:link`
61+
3. `php artisan migrate && php artisan db:seed`
62+
4. `php artisan octane:install`
63+
5. `php artisan octane:start --watch --port=8000 --host=127.0.0.1`
64+
6. `yarn dev`
65+
66+
### Docker Deploy (Laravel Sail)
67+
[Laravel Sail](https://laravel.com/docs/11.x/sail) is a light-weight command-line interface for interacting with Laravel's default Docker development environment. Sail provides a great starting point for building a Laravel application using PHP, MySQL, and Redis without requiring prior Docker experience.
68+
69+
At its heart, Sail is the `docker-compose.yml` file and the `sail` script that is stored at the root of your project. The sail script provides a CLI with convenient methods for interacting with the Docker containers defined by the docker-compose.yml file.
70+
71+
Laravel Sail is supported on macOS, Linux, and Windows (via [WSL2](https://docs.microsoft.com/en-us/windows/wsl/about)).
72+
1. Installing Composer Dependencies
73+
```shell
74+
docker run --rm \
75+
-u "$(id -u):$(id -g)" \
76+
-v "$(pwd):/var/www/html" \
77+
-w /var/www/html \
78+
laravelsail/php83-composer:latest \
79+
composer install --ignore-platform-reqs
80+
```
81+
2. Configuring A Shell Alias (Optional)
82+
```shell
83+
alias sail='sh $([ -f sail ] && echo sail || echo vendor/bin/sail)'
84+
```
85+
To make sure this is always available, you may add this to your shell configuration file in your home directory, such as ~/.zshrc or ~/.bashrc, and then restart your shell.
86+
3. `sail up`
87+
4. `sail yarn install`
88+
5. `sail yarn dev`
89+
90+
> Read the full [Laravel Sail](https://laravel.com/docs/11.x/sail) documentation to get the best user experience
6491
6592
## Upgrade
66-
1. `npx nuxi upgrade`
67-
2. `composer update`
93+
94+
Standalone:
95+
```shell
96+
npx nuxi upgrade
97+
composer update
98+
```
99+
100+
Sail:
101+
```shell
102+
sail npx nuxi upgrade
103+
sail composer update
104+
```
68105

69106
> Nuxt port is set in package.json scripts via **cross-env**
70107

0 commit comments

Comments
 (0)