Upgrade to Pro — share decks privately, control downloads, hide ads and more …

The Minimal Dev (June 2017)

The Minimal Dev (June 2017)

No offense, but most local development environments are overkill. Vagrant is great if you want to match your site’s production environment, but it can often be fussy, and slow to spin up. Docker runs faster and is more lightweight, but it can be hard to get up and running if you’re not intimately familiar with how containers work.

Laravel’s Valet project is a simplified, local, PHP development environment for minimalists that uses lightweight packages—not virtual machines— to speed up development time.

In this session I will demonstrate how to install Valet, show off some of the features that make it so useful for WordPress developers, and share some power user tricks that I’ve learned while using it.

Jason Cosper

June 10, 2017
Tweet

More Decks by Jason Cosper

Other Decks in Technology

Transcript

  1. Dev environments • Vagrant • Docker • DesktopServer • Local

    • Chassis • MAMP • WAMP boogah.org/wcoc17
  2. Installing Valet (Homebrew) # Install Xcode Command Line Tools !

    xcode-select --install # Install Homebrew ! /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" # Update Homebrew Package Index ! brew update # Confirm Homebrew is Installed Correctly ! brew doctor boogah.org/wcoc17
  3. Installing Valet (PHP 7) # Install PHP 7.0 ! brew

    tap homebrew/php ! brew install php70 # Install Xdebug (optional) ! brew install php70-xdebug # Confirm PHP is Installed Correctly ! php -v boogah.org/wcoc17
  4. Installing Valet (MySQL) # Install MySQL ! brew install mariadb

    # Launch MySQL at Login ! brew services start mariadb boogah.org/wcoc17
  5. Installing Valet (Composer) # Install Composer ! brew install composer

    # Confirm Composer is Installed Correctly ! composer -V boogah.org/wcoc17
  6. Installing Valet (Valet) # Install Valet (Part 1) ! composer

    global require laravel/valet # Install Valet (Part 2) ! valet install # Create a Directory for Valet Sites ! mkdir ~/sites/valet/ ! cd ~/sites/valet/ ! valet park boogah.org/wcoc17
  7. Install WP-CLI ! curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar ! php wp-cli.phar --info

    ! chmod +x wp-cli.phar ! sudo mv wp-cli.phar /usr/local/bin/wp From wp-cli.org boogah.org/wcoc17
  8. Create a site ! wp valet new modok --admin_user=modok --admin_password=advanced-idea-mechanics

    Don't go anywhere, this should only take a second... Success: modok ready! https://modok.dev boogah.org/wcoc17
  9. Destroy a site ! wp valet destroy modok --yes Success:

    modok was destroyed. boogah.org/wcoc17
  10. Showing off ! cd ~/sites/valet/modok ! valet share ngrok by

    @inconshreveable (Ctrl+C to quit) Session Status online Version 2.2.4 Region United States (us) Web Interface http://127.0.0.1:4040 Forwarding http://bf40fa0e.ngrok.io -> modok.dev:443 Forwarding https://bf40fa0e.ngrok.io -> modok.dev:443 Connections ttl opn rt1 rt5 p50 p90 0 0 0.00 0.00 0.00 0.00 boogah.org/wcoc17