Skip to content

Latest commit

 

History

History

valet

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
Site Updated Requires
2023-11-05
brew
php
composer

Laravel

Laravel is my preferred way to set up a development environment on a local machine, such as macOS.

Install

First, make sure you have completed the installation steps in install-system.sh to install PHP and Composer.

Then, run the following commands to install Valet and trust the local domain:

composer global require laravel/valet
valet install
valet trust

To test that everything is working, run the following command:

ping -c1 localhost.test

This will ping the local domain and should return a 404 page.

Database

There are two ways to set up the database: with DBngin or manually.

I chose to set up the database manually, which is the option that is run by the install.sh script.

The manually setup
  1. Install MySQL with Homebrew:
brew install [email protected]
  1. Start MySQL:
brew services start [email protected]
  1. Set the MySQL password:
mysql -u root
ALTER USER 'root'@'localhost' IDENTIFIED BY 'root'; FLUSH PRIVILEGES;

Setup based on: https://sqlpad.io/tutorial/mysql-install-mac/

The DBngin setup
  1. Install DBngin:
brew install --cask dbngin
  1. Create a MySQL service in DBngin:
  • name = mysql
  • port = 3306
  • socket = /tmp/mysql.sock
  • disable log = true
  • auto start = true
  1. Add the following export path to your PATH environment variable:
export PATH=/Users/Shared/DBngin/mysql/5.7.23/bin:$PATH
  1. Set the MySQL password:
mysql -u root
ALTER USER 'root'@'localhost' IDENTIFIED BY 'root'; FLUSH PRIVILEGES;