|
9 | 9 | - [Environment Based Configuration](#environment-based-configuration)
|
10 | 10 | - [Databases and Migrations](#databases-and-migrations)
|
11 | 11 | - [Directory Configuration](#directory-configuration)
|
12 |
| -- [Local Installation Using Herd](#local-installation-using-herd) |
| 12 | +- [Installation Using Herd](#installation-using-herd) |
13 | 13 | - [Herd on macOS](#herd-on-macos)
|
14 | 14 | - [Herd on Windows](#herd-on-windows)
|
15 |
| -- [Docker Installation Using Sail](#docker-installation-using-sail) |
16 |
| - - [Sail on macOS](#sail-on-macos) |
17 |
| - - [Sail on Windows](#sail-on-windows) |
18 |
| - - [Sail on Linux](#sail-on-linux) |
19 |
| - - [Choosing Your Sail Services](#choosing-your-sail-services) |
20 | 15 | - [IDE Support](#ide-support)
|
21 | 16 | - [Next Steps](#next-steps)
|
22 | 17 | - [Laravel the Full Stack Framework](#laravel-the-fullstack-framework)
|
@@ -157,8 +152,8 @@ php artisan migrate
|
157 | 152 |
|
158 | 153 | Laravel should always be served out of the root of the "web directory" configured for your web server. You should not attempt to serve a Laravel application out of a subdirectory of the "web directory". Attempting to do so could expose sensitive files present within your application.
|
159 | 154 |
|
160 |
| -<a name="local-installation-using-herd"></a> |
161 |
| -## Local Installation Using Herd |
| 155 | +<a name="installation-using-herd"></a> |
| 156 | +## Installation Using Herd |
162 | 157 |
|
163 | 158 | [Laravel Herd](https://herd.laravel.com) is a blazing fast, native Laravel and PHP development environment for macOS and Windows. Herd includes everything you need to get started with Laravel development, including PHP and Nginx.
|
164 | 159 |
|
@@ -207,150 +202,6 @@ herd open
|
207 | 202 |
|
208 | 203 | You can learn more about Herd by checking out the [Herd documentation for Windows](https://herd.laravel.com/docs/windows).
|
209 | 204 |
|
210 |
| -<a name="docker-installation-using-sail"></a> |
211 |
| -## Docker Installation Using Sail |
212 |
| - |
213 |
| -We want it to be as easy as possible to get started with Laravel regardless of your preferred operating system. So, there are a variety of options for developing and running a Laravel application on your local machine. While you may wish to explore these options at a later time, Laravel provides [Sail](/docs/{{version}}/sail), a built-in solution for running your Laravel application using [Docker](https://www.docker.com). |
214 |
| - |
215 |
| -Docker is a tool for running applications and services in small, light-weight "containers" which do not interfere with your local machine's installed software or configuration. This means you don't have to worry about configuring or setting up complicated development tools such as web servers and databases on your local machine. To get started, you only need to install [Docker Desktop](https://www.docker.com/products/docker-desktop). |
216 |
| - |
217 |
| -Laravel Sail is a light-weight command-line interface for interacting with Laravel's default Docker configuration. Sail provides a great starting point for building a Laravel application using PHP, MySQL, and Redis without requiring prior Docker experience. |
218 |
| - |
219 |
| -> [!NOTE] |
220 |
| -> Already a Docker expert? Don't worry! Everything about Sail can be customized using the `docker-compose.yml` file included with Laravel. |
221 |
| -
|
222 |
| -<a name="sail-on-macos"></a> |
223 |
| -### Sail on macOS |
224 |
| - |
225 |
| -If you're developing on a Mac and [Docker Desktop](https://www.docker.com/products/docker-desktop) is already installed, you can use a simple terminal command to create a new Laravel application. For example, to create a new Laravel application in a directory named "example-app", you may run the following command in your terminal: |
226 |
| - |
227 |
| -```shell |
228 |
| -curl -s "https://laravel.build/example-app" | bash |
229 |
| -``` |
230 |
| - |
231 |
| -Of course, you can change "example-app" in this URL to anything you like - just make sure the application name only contains alpha-numeric characters, dashes, and underscores. The Laravel application's directory will be created within the directory you execute the command from. |
232 |
| - |
233 |
| -Sail installation may take several minutes while Sail's application containers are built on your local machine. |
234 |
| - |
235 |
| -After the application has been created, you can navigate to the application directory and start Laravel Sail. Laravel Sail provides a simple command-line interface for interacting with Laravel's default Docker configuration: |
236 |
| - |
237 |
| -```shell |
238 |
| -cd example-app |
239 |
| - |
240 |
| -./vendor/bin/sail up |
241 |
| -``` |
242 |
| - |
243 |
| -Once the application's Docker containers have started, you should run your application's [database migrations](/docs/{{version}}/migrations): |
244 |
| - |
245 |
| -```shell |
246 |
| -./vendor/bin/sail artisan migrate |
247 |
| -``` |
248 |
| - |
249 |
| -Finally, you can access the application in your web browser at: http://localhost. |
250 |
| - |
251 |
| -> [!NOTE] |
252 |
| -> To continue learning more about Laravel Sail, review its [complete documentation](/docs/{{version}}/sail). |
253 |
| -
|
254 |
| -<a name="sail-on-windows"></a> |
255 |
| -### Sail on Windows |
256 |
| - |
257 |
| -Before we create a new Laravel application on your Windows machine, make sure to install [Docker Desktop](https://www.docker.com/products/docker-desktop). Next, you should ensure that Windows Subsystem for Linux 2 (WSL2) is installed and enabled. WSL allows you to run Linux binary executables natively on Windows 10. Information on how to install and enable WSL2 can be found within Microsoft's [developer environment documentation](https://docs.microsoft.com/en-us/windows/wsl/install-win10). |
258 |
| - |
259 |
| -> [!NOTE] |
260 |
| -> After installing and enabling WSL2, you should ensure that Docker Desktop is [configured to use the WSL2 backend](https://docs.docker.com/docker-for-windows/wsl/). |
261 |
| -
|
262 |
| -Next, you are ready to create your first Laravel application. Launch [Windows Terminal](https://www.microsoft.com/en-us/p/windows-terminal/9n0dx20hk701?rtc=1&activetab=pivot:overviewtab) and begin a new terminal session for your WSL2 Linux operating system. Next, you can use a simple terminal command to create a new Laravel application. For example, to create a new Laravel application in a directory named "example-app", you may run the following command in your terminal: |
263 |
| - |
264 |
| -```shell |
265 |
| -curl -s https://laravel.build/example-app | bash |
266 |
| -``` |
267 |
| - |
268 |
| -Of course, you can change "example-app" in this URL to anything you like - just make sure the application name only contains alpha-numeric characters, dashes, and underscores. The Laravel application's directory will be created within the directory you execute the command from. |
269 |
| - |
270 |
| -Sail installation may take several minutes while Sail's application containers are built on your local machine. |
271 |
| - |
272 |
| -After the application has been created, you can navigate to the application directory and start Laravel Sail. Laravel Sail provides a simple command-line interface for interacting with Laravel's default Docker configuration: |
273 |
| - |
274 |
| -```shell |
275 |
| -cd example-app |
276 |
| - |
277 |
| -./vendor/bin/sail up |
278 |
| -``` |
279 |
| - |
280 |
| -Once the application's Docker containers have started, you should run your application's [database migrations](/docs/{{version}}/migrations): |
281 |
| - |
282 |
| -```shell |
283 |
| -./vendor/bin/sail artisan migrate |
284 |
| -``` |
285 |
| - |
286 |
| -Finally, you can access the application in your web browser at: http://localhost. |
287 |
| - |
288 |
| -> [!NOTE] |
289 |
| -> To continue learning more about Laravel Sail, review its [complete documentation](/docs/{{version}}/sail). |
290 |
| -
|
291 |
| -#### Developing Within WSL2 |
292 |
| - |
293 |
| -Of course, you will need to be able to modify the Laravel application files that were created within your WSL2 installation. To accomplish this, we recommend using Microsoft's [Visual Studio Code](https://code.visualstudio.com) editor and their first-party extension for [Remote Development](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.vscode-remote-extensionpack). |
294 |
| - |
295 |
| -Once these tools are installed, you may open any Laravel application by executing the `code .` command from your application's root directory using Windows Terminal. |
296 |
| - |
297 |
| -<a name="sail-on-linux"></a> |
298 |
| -### Sail on Linux |
299 |
| - |
300 |
| -If you're developing on Linux and [Docker Compose](https://docs.docker.com/compose/install/) is already installed, you can use a simple terminal command to create a new Laravel application. |
301 |
| - |
302 |
| -First, if you are using Docker Desktop for Linux, you should execute the following command. If you are not using Docker Desktop for Linux, you may skip this step: |
303 |
| - |
304 |
| -```shell |
305 |
| -docker context use default |
306 |
| -``` |
307 |
| - |
308 |
| -Then, to create a new Laravel application in a directory named "example-app", you may run the following command in your terminal: |
309 |
| - |
310 |
| -```shell |
311 |
| -curl -s https://laravel.build/example-app | bash |
312 |
| -``` |
313 |
| - |
314 |
| -Of course, you can change "example-app" in this URL to anything you like - just make sure the application name only contains alpha-numeric characters, dashes, and underscores. The Laravel application's directory will be created within the directory you execute the command from. |
315 |
| - |
316 |
| -Sail installation may take several minutes while Sail's application containers are built on your local machine. |
317 |
| - |
318 |
| -After the application has been created, you can navigate to the application directory and start Laravel Sail. Laravel Sail provides a simple command-line interface for interacting with Laravel's default Docker configuration: |
319 |
| - |
320 |
| -```shell |
321 |
| -cd example-app |
322 |
| - |
323 |
| -./vendor/bin/sail up |
324 |
| -``` |
325 |
| - |
326 |
| -Once the application's Docker containers have started, you should run your application's [database migrations](/docs/{{version}}/migrations): |
327 |
| - |
328 |
| -```shell |
329 |
| -./vendor/bin/sail artisan migrate |
330 |
| -``` |
331 |
| - |
332 |
| -Finally, you can access the application in your web browser at: http://localhost. |
333 |
| - |
334 |
| -> [!NOTE] |
335 |
| -> To continue learning more about Laravel Sail, review its [complete documentation](/docs/{{version}}/sail). |
336 |
| -
|
337 |
| -<a name="choosing-your-sail-services"></a> |
338 |
| -### Choosing Your Sail Services |
339 |
| - |
340 |
| -When creating a new Laravel application via Sail, you may use the `with` query string variable to choose which services should be configured in your new application's `docker-compose.yml` file. Available services include `mysql`, `pgsql`, `mariadb`, `redis`, `valkey`, `memcached`, `meilisearch`, `typesense`, `minio`, `selenium`, and `mailpit`: |
341 |
| - |
342 |
| -```shell |
343 |
| -curl -s "https://laravel.build/example-app?with=mysql,redis" | bash |
344 |
| -``` |
345 |
| - |
346 |
| -If you do not specify which services you would like configured, a default stack of `mysql`, `redis`, `meilisearch`, `mailpit`, and `selenium` will be configured. |
347 |
| - |
348 |
| -You may instruct Sail to install a default [Devcontainer](/docs/{{version}}/sail#using-devcontainers) by adding the `devcontainer` parameter to the URL: |
349 |
| - |
350 |
| -```shell |
351 |
| -curl -s "https://laravel.build/example-app?with=mysql,redis&devcontainer" | bash |
352 |
| -``` |
353 |
| - |
354 | 205 | <a name="ide-support"></a>
|
355 | 206 | ## IDE Support
|
356 | 207 |
|
|
0 commit comments