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
Copy file name to clipboardExpand all lines: README.md
+20Lines changed: 20 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -36,6 +36,26 @@ volumes:
36
36
- ./mysql:/var/lib/mysql
37
37
```
38
38
39
+
##Using BrowserSync with Laravel Mix
40
+
41
+
If you want to enable the hot-reloading that comes with Laravel Mix's BrowserSync option, you'll have to follow a few small steps. First, ensure that you're using the updated`docker-compose.yml` with the`:3000` and`:3001` ports open on the npm service. Then, add the following to the end of your Laravel project's`webpack.mix.js` file:
42
+
43
+
```javascript
44
+
.browserSync({
45
+
proxy:'nginx',
46
+
open:false,
47
+
port:3000,
48
+
});
49
+
```
50
+
51
+
From your terminal window at the project root, run the following command to start watching for changes with the npm container and its mapped ports:
52
+
53
+
```bash
54
+
docker-compose run --rm --service-ports npm run watch
55
+
```
56
+
57
+
That should keep a small info pane open in your terminal (which you can exit with Ctrl + C). Visiting[localhost:3000](http://localhost:3000) in your browser should then load up your Laravel application with BrowserSync enabled and hot-reloading active.
58
+
39
59
##MailHog
40
60
41
61
The current version of Laravel (8 as of today) uses MailHog as the default application for testing email sending and general SMTP work during local development. Using the provided Docker Hub image, getting an instance set up and ready is simple and straight-forward. The service is included in the`docker-compose.yml` file, and spins up alongside the webserver and database services.