Installing Laravel with Herd
Laravel is written in PHP, so before your first page you need PHP itself, Composer (PHP's package manager), a web server and usually Node for building CSS and JavaScript. Installing and wiring these by hand used to eat an afternoon. Laravel Herd does it in one download for macOS and Windows.
The rule
Install Herd once; every folder in ~/Herd becomes a .test site.
Herd is a desktop app. Installing it gives you, already configured:
- PHP, and you can switch versions from the Herd menu.
- Composer, for installing PHP packages.
- The
laravelinstaller command, for creating projects. - Node and npm, for front-end assets.
- A web server that serves your projects automatically.
The key idea is the parked folder. By default it is ~/Herd (your home folder, then Herd). Herd serves every folder inside it at an address made from the folder name plus .test:
cd ~/Herd
laravel new lendly
# now open http://lendly.testYou do not start a server or edit any config. The folder lendly simply becomes lendly.test.
Two more commands help when your code lives somewhere else:
herd parkin a folder makes that folder a parked folder too, so every project inside it is served.herd linkinside a single project serves just that project, named after its folder.
The free version of Herd covers everything in this course. The paid Herd Pro adds extras such as bundled database and mail-testing services.
Not using Herd? The route still works: install PHP and Composer yourself, create the project, then run php artisan serve, which starts a development server at http://127.0.0.1:8000.