Pebellslearn by building
0%
RoadmapsMatrixCoursesSandboxSign in
Getting Started with Laravel  ›  Capstone Project

Create a New Project

Create a new project 15 minRunning laravel new asks a few questions, such as starter kit, test framework and database, then builds a ready-to-run app whose secrets live in .env.

Create a New Project

You have the tools. Now one command turns an empty folder into a working Laravel app with a welcome page, a database and tests ready to run. The command asks a few questions on the way, and each answer shapes the project.

The rule

laravel new asks, builds, then .env holds the machine-specific settings.

Create Lendly with the installer:

laravel new lendly

The installer asks a short series of questions. The exact wording changes between versions, but in Laravel 12 you meet these:

  1. Starter kit: none, React, Vue or Livewire. Choosing none gives a bare app. The next section covers the kits.
  2. Testing framework: Pest or PHPUnit.
  3. Database: SQLite is the default and needs no server, since the whole database is one file in database/.
  4. Whether to run npm install and build front-end assets.

Without the installer, Composer does the same core job:

composer create-project laravel/laravel lendly

Then it builds. It downloads packages into vendor/, copies .env.example to .env, generates an APP_KEY inside it, and runs the first migrations so the default tables exist.

.env is the file for settings that differ per machine, and for secrets:

APP_NAME=Lendly
APP_ENV=local
APP_DEBUG=true
APP_URL=http://lendly.test
DB_CONNECTION=sqlite

It is listed in .gitignore, so it never goes to git. Teammates copy .env.example and fill in their own values.

To see the app, open http://lendly.test if the folder is parked in Herd. Otherwise, run composer run dev, which starts the PHP server, the Vite asset builder and a queue worker together, and open http://127.0.0.1:8000.

The shortcut

Read a fresh project as three layers: the code you will edit, the settings in .env, and the downloaded packages in vendor/. Only the first is yours to write. The second is yours to configure. The third you never touch.

Lendly's first five minutesStep 1 of 4
  1. Run the installer

    laravel new lendly and pick: no starter kit, Pest, SQLite.

The trap is committing .env. It holds your app key and, later, database passwords. Commit .env.example with blank secrets instead.

Drills

Answer fast — trust the rule.

quick drill

Which file should a teammate copy to get their own settings?

quick drill

Why is SQLite a handy default for a new project?

quick drill

Where does laravel new put downloaded packages?

quick drill

You want the browser tab to say "Lendly". What is the quickest correct change?

quick drill

What does composer run dev start?

Remember

  • laravel new asks, builds, and leaves machine-specific settings in .env.
  • Three layers: your code, your .env, and vendor/, which you never touch.
  • Trap: never commit .env. Share .env.example instead.

Practice — level up

0/1 solved

Write your answer, then compare it with a rubric and a model answer.

ExplainFrom empty folder to first page

Walk through creating Lendly from nothing to seeing its welcome page. Name the command, the choices the installer asks about, the file that holds settings like the database, and how you view the page.