My Laravel Setup

This is a writeup on how I setup my local development to help make sure I'm productive working in the Laravel framework.

Setup the Project

I like to use my Laravel 9 Starter repo since it has Laravel as well as helpful packages I usually use on all my projects. My goal is to run the below steps for a simple setup.

Install Docker on your machine.
https://docs.docker.com/get-docker/

git clone https://github.com/imperez/laravel-9-starter example-project
cd example-project
docker run --rm \
   -u "$(id -u):$(id -g)" \
   -v $(pwd):/var/www/html \
   -w /var/www/html \
   laravelsail/php81-composer:latest \
   composer install --ignore-platform-reqs
./vendor/bin/sail up

Once this is done you should have a basic Laravel project running in Docker and can be accessed at http://localhost

Setup your Editor

The next phase is to setup an editor. For me I use Microsoft's Visual Studio Code and install below extensions.

Better Comments - Visual Studio Marketplace
Extension for Visual Studio Code - Improve your code commenting by annotating with alert, informational, TODOs, and more!
DotENV - Visual Studio Marketplace
Extension for Visual Studio Code - Support for dotenv file syntax
Error Lens - Visual Studio Marketplace
Extension for Visual Studio Code - Improve highlighting of errors, warnings and other language diagnostics.
laravel-blade - Visual Studio Marketplace
Extension for Visual Studio Code - Laravel blade syntax highlighting
PHP DocBlocker - Visual Studio Marketplace
Extension for Visual Studio Code - A simple, dependency free PHP specific DocBlocking package
Laravel Extra Intellisense - Visual Studio Marketplace
Extension for Visual Studio Code - better intellisense for laravel projects.
PHP Intelephense - Visual Studio Marketplace
Extension for Visual Studio Code - PHP code intelligence for Visual Studio Code