DEV Community

ServBay
ServBay

Posted on

Laravel 11 with Servbay: Quick Start Guide

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
Enter fullscreen mode Exit fullscreen mode

This will create an example-app directory, cd to it.

cd example-app
Enter fullscreen mode Exit fullscreen mode

Now you can start the server:

php artisan serve

Enter fullscreen mode Exit fullscreen mode

Go to http://127.0.0.1:8000 and you'll see the default Laravel welcome page.

Image description

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

Image description

  1. Open ServBay.app and follow the initialization steps

Image description

Image description

Image description

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

Image description

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.

Image description

From now on, you can use ServBay for Laravel local development, happy coding!

Check video for more.

Top comments (0)