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.
composer create-project laravel/laravel example-app
This will create an example-app directory, cd to it.
cd example-app
Now you can start the server:<p>php artisan serve
Go to http://127.0.0.1:8000 and you'll see the default Laravel welcome page.<p>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:
1. Go to Servbay's home page: https://www.servbay.com
2. Download the latest version
3. Open the installer and drag ServBay.app into the Applications folder<p>4. Open ServBay.app and follow the initialization steps<p>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.
1. Set Name to "Laravel 11 Demo"
2. Set Domain to "lara.host",
3. 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.<p>From now on, you can use ServBay for Laravel local development, happy coding!