You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> The `share` command is powered by [Expose](https://github.com/beyondcode/expose), an open source tunneling service by [BeyondCode](https://beyondco.de).
495
495
496
+
<a name="sail-customization"></a>
497
+
## Customization
498
+
499
+
Since Sail is just Docker, you are free to customize nearly everything about it. To publish Sail's own Dockerfiles, you may execute the `sail:publish` command:
500
+
501
+
```shell
502
+
sail artisan sail:publish
503
+
```
504
+
505
+
After running this command, the Dockerfiles and other configuration files used by Laravel Sail will be placed within a `docker` directory in your application's root directory. After customizing your Sail installation, you may wish to change the image name for the application container in your application's `docker-compose.yml` file. After doing so, rebuild your application's containers using the `build` command. Assigning a unique name to the application image is particularly important if you are using Sail to develop multiple Laravel applications on a single machine:
506
+
507
+
```shell
508
+
sail build --no-cache
509
+
```
510
+
496
511
<a name="debugging-with-xdebug"></a>
497
512
## Debugging With Xdebug
498
513
499
-
Laravel Sail's Docker configuration includes support for [Xdebug](https://xdebug.org/), a popular and powerful debugger for PHP. In order to enable Xdebug, you will need to add a few variables to your application's `.env` file to [configure Xdebug](https://xdebug.org/docs/step_debug#mode). To enable Xdebug you must set the appropriate mode(s) before starting Sail:
514
+
Laravel Sail's Docker configuration includes support for [Xdebug](https://xdebug.org/), a popular and powerful debugger for PHP. To enable Xdebug, ensure you have published your Sail configuration as described in the [Customization section](#sail-customization). Then, add the following variables to your application's `.env` file to configure Xdebug:
500
515
501
516
```ini
502
517
SAIL_XDEBUG_MODE=develop,debug,coverage
503
518
```
504
519
520
+
Ensure that your `php.ini` file includes this line to activate the specified modes:
521
+
522
+
```ini
523
+
[xdebug]
524
+
xdebug.mode=${XDEBUG_MODE}
525
+
```
526
+
527
+
After modifying the `php.ini` file, remember to rebuild your Docker container for the changes to take effect:
528
+
529
+
```shell
530
+
sail build --no-cache
531
+
```
532
+
533
+
To verify that Xdebug is correctly set, run:
534
+
535
+
```shell
536
+
sail php -i | grep xdebug.mode
537
+
```
538
+
539
+
This command should return the value set in `SAIL_XDEBUG_MODE`, confirming the correct configuration.
540
+
505
541
#### Linux Host IP Configuration
506
542
507
543
Internally, the `XDEBUG_CONFIG` environment variable is defined as `client_host=host.docker.internal` so that Xdebug will be properly configured for Mac and Windows (WSL2). If your local machine is running Linux and you're using Docker 20.10+, `host.docker.internal` is available, and no manual configuration is required.
@@ -550,18 +586,3 @@ If you're using PhpStorm, please review JetBrains' documentation regarding [zero
550
586
551
587
> [!WARNING]
552
588
> Laravel Sail relies on `artisan serve` to serve your application. The `artisan serve` command only accepts the `XDEBUG_CONFIG` and `XDEBUG_MODE` variables as of Laravel version 8.53.0. Older versions of Laravel (8.52.0 and below) do not support these variables and will not accept debug connections.
553
-
554
-
<a name="sail-customization"></a>
555
-
## Customization
556
-
557
-
Since Sail is just Docker, you are free to customize nearly everything about it. To publish Sail's own Dockerfiles, you may execute the `sail:publish` command:
558
-
559
-
```shell
560
-
sail artisan sail:publish
561
-
```
562
-
563
-
After running this command, the Dockerfiles and other configuration files used by Laravel Sail will be placed within a `docker` directory in your application's root directory. After customizing your Sail installation, you may wish to change the image name for the application container in your application's `docker-compose.yml` file. After doing so, rebuild your application's containers using the `build` command. Assigning a unique name to the application image is particularly important if you are using Sail to develop multiple Laravel applications on a single machine:
0 commit comments