Skip to content
This repository has been archived by the owner on Oct 8, 2024. It is now read-only.

Commit

Permalink
📓 simplify setup
Browse files Browse the repository at this point in the history
  • Loading branch information
tyler36 committed May 19, 2022
1 parent d30a7c3 commit 7b8bd8b
Showing 1 changed file with 10 additions and 39 deletions.
49 changes: 10 additions & 39 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
- [Intro](#intro)
- [Requirements](#requirements)
- [Setup](#setup)
- [Demo 1: Host with artisan server](#demo-1-host-with-artisan-server)
- [DDEV & Laravel mix](#ddev--laravel-mix)
- [Errors](#errors)
- ['400 Bad Request: The plain HTTP request was sent to HTTPS port'](#400-bad-request-the-plain-http-request-was-sent-to-https-port)

Expand All @@ -23,57 +21,30 @@ It runs BrowserSync through [`laravel-mix`](https://laravel-mix.com/).
## Setup

- Clone project
- Start DDEV

```shell
ddev start
```

- Install depenendencies & packages

```shell
ddev composer install
ddev ssh
npm install
```

- Copy `.env.example` to `.env`

```shell
cp .env.example .env
```

- Add Laravel key

```shell
php artisan key:generate
git clone https://github.com/tyler36/browsersync-demo
cd browsersync-demo
```

### Demo 1: Host with artisan server

Confirm browser sync works on host.

- Run Laravel's serer
- Start DDEV

```shell
php artisan serve
ddev start
```

- In a seperate terminal, run laravel-mix watcher
- Install depenendencies & packages

```shell
npm run watch
ddev composer install
ddev exec npm install
```

- Visit [http://127.0.0.1:8000](http://127.0.0.1:8000) in browser
- Update `./resources/views/welcome.blade.php` and confirm browser refreshed.

### DDEV & Laravel mix

- Install NPM packages in DDEV
- Configure Laravel environment

```shell
ddev exec npm install
ddev exec cp .env.example .env
ddev exec php artisan key:generate
```

- Add [browsersync](https://laravel-mix.com/docs/4.0/browsersync) to Laravel Mix's `./webpack.mix.js`
Expand Down

0 comments on commit 7b8bd8b

Please sign in to comment.