Domain

Install Laravel Valet.

Install Trellis Valet Driver: https://github.com/danielroe/trellis-valet-driver – This will make Trellis projects work in Laravel Valet.

Open your hosts file and comment out your vagrant hosts

## vagrant-hostmanager-start id: c75a370e-674a-4ae9-a39f-861f9edcdf4b
#192.168.50.6 www.mysite.test
#192.168.50.6 mysite.test
## vagrant-hostmanager-end

While still having the hosts file open add these lines

127.0.0.1 www.mysite.test
127.0.0.1 mysite.test

Flush the DNS cache with the following command

sudo dscacheutil -flushcache

Now it is time to link the test domain to Laravel Valet

cd ~/Sites/mysite.test

valet link mysite

Secure the site so you can access it using https

valet secure mysite

Database

Create a database like you normally do when using Valet

Import your database into this new database.

In your Bedrock folder locate the .env file and change the following lines.

DB_NAME='mysite_com_development'
DB_PASSWORD='your_db_password'
DB_USER='your_db_user'

You might want to add a new user with the same username and password as you might want to use the same db password. This will make it easy to switch back to Trellis if you need to test something here.

Switching back

Just inverse the comments in the hosts file and flush the DNS cache aftwards. You might want to update your database in your Vagrant setup as this might be outdated now.

Leave a Reply

Your email address will not be published. Required fields are marked *