Introduction
Laravel 11 has been released, bringing many improvements.
It introduces a streamlined application structure, per-second rate limiting, health routing, and more.
In addition, Laravel Reverb, a first-party, scalable WebSocket server has been introduced to provide robust real-time capabilities to your applications.
In today’s guide, I will setup an example laravel application, and install ServBay for local development on Mac.
NOTE: ServBay is your one-stop-shop for local PHP development on Mac. It bundles together everything you need like web servers, databases, programming languages, mail servers and queue services.
Create Example Application
Let’s get started generating an example applicaiton using composer.
This will create an example-app directory, cd to it.
Now you can start the server:
Go to http://127.0.0.1:8000 and you’ll see the default Laravel welcome page.
Install ServBay
We’ll use ServBay to manage our local PHP development environment on Mac.
ServBay includes multiple versions of PHP/Node/MariaDB/PostgreSQL, and it can install Redis/Memcached for you.
These are the steps to install ServBay:
Go to Servbay’s home page: https://www.servbay.com
Download the latest version
Open the installer and drag ServBay.app into the Applications folder
Open ServBay.app and follow the initialization steps
Add a New Host
After installing ServBay, you can add a new host for your example laravel application.
Go to the Hosts tab, click the plus button, and you’ll see the Add Host form.
Set Name to “Laravel 11 Demo”
Set Domain to “lara.host”,
Set Root Directory to the public folder of example-app
Hit the “Add” button and you’re ready to go.
Now visit lara.host and you will see the default welcome page from the example-app.
From now on, you can use ServBay for Laravel local development, happy coding!