Open-Source Wikis

/

Laravel

/

Laravel application skeleton

/

Getting started

laravel/laravel

Getting started

This page covers what you need to install, build, run, and test the skeleton locally. It is written for someone who has just cloned laravel/laravel and wants the app responding on http://localhost:8000 as fast as possible.

Prerequisites

Tool Version Why
PHP 8.3, 8.4, or 8.5 composer.json requires ^8.3; CI matrix in .github/workflows/tests.yml runs all three
Composer 2.x Reads composer.json, installs vendor/
Node.js Recent LTS Runs Vite 8 (package.json)
SQLite Bundled with PHP Default DB_CONNECTION (see .env.example)
ext-pdo, ext-pdo_sqlite, ext-mbstring, ext-dom, ext-curl, ext-zip Listed in the GitHub Actions test workflow

You can swap SQLite for MySQL, MariaDB, PostgreSQL, or SQL Server — every connection is pre-configured in config/database.php. Set DB_CONNECTION and the matching credentials in .env.

Install

The repository's composer.json defines a setup script that does everything in one shot:

composer setup

This script (from composer.json) runs:

  1. composer install — populates vendor/.
  2. Copies .env.example to .env if .env does not exist.
  3. php artisan key:generate — writes a 32-byte APP_KEY into .env.
  4. php artisan migrate --force — creates the SQLite file and runs the three baseline migrations.
  5. npm install --ignore-scripts — installs Node deps. The --ignore-scripts flag is enforced by .npmrc.
  6. npm run build — produces a production frontend bundle in public/build/.

If you prefer to step through it manually:

composer install
cp .env.example .env
php artisan key:generate
touch database/database.sqlite     # if the SQLite file doesn't exist
php artisan migrate
npm install
npm run build

The post-create-project-cmd hook (when you go through composer create-project laravel/laravel) does most of this automatically, including touch-ing database/database.sqlite if it isn't there.

Run

For day-to-day development, the composer dev script runs four processes in parallel via npx concurrently:

composer dev

Per composer.json, that resolves to:

npx concurrently -c "#93c5fd,#c4b5fd,#fb7185,#fdba74" \
  "php artisan serve" \
  "php artisan queue:listen --tries=1 --timeout=0" \
  "php artisan pail --timeout=0" \
  "npm run dev" \
  --names=server,queue,logs,vite \
  --kill-others
Pane Command Job
server php artisan serve Runs PHP's built-in server on http://127.0.0.1:8000
queue php artisan queue:listen --tries=1 Pulls jobs from the database queue connection
logs php artisan pail --timeout=0 Tails storage/logs/laravel.log with formatted output
vite npm run dev Vite dev server with HMR

Hit Ctrl-C once and concurrently --kill-others shuts down all four panes.

If you only want the web server, php artisan serve is the smaller knob.

Test

composer test

This runs:

php artisan config:clear --ansi @no_additional_args
php artisan test

php artisan test is a thin wrapper around PHPUnit that uses phpunit.xml and applies coloured output. The test matrix is defined in phpunit.xml:

  • Test suite Unittests/Unit/
  • Test suite Featuretests/Feature/

Out of the box you get:

  • tests/Unit/ExampleTest.phpassertTrue(true), no Laravel boot.
  • tests/Feature/ExampleTest.php — boots the framework and asserts GET / returns 200.

To run a specific suite or filter:

php artisan test --testsuite=Unit
php artisan test --filter=ExampleTest

Useful Artisan commands

The skeleton ships with whatever ships with laravel/framework plus the dev packages laravel/pail (live log tail), laravel/pao (recently added — see composer.json), laravel/pint (code style), and laravel/tinker (REPL).

Command What it does
php artisan tinker Interactive PHP REPL with the app booted
php artisan migrate Apply outstanding migrations
php artisan migrate:fresh --seed Drop everything, re-run migrations, run database/seeders/DatabaseSeeder.php
php artisan pint Format the codebase per the laravel preset
php artisan pail Live-tail formatted logs
php artisan route:list Print every registered route
php artisan config:cache Bake config/*.php into a single cached file (production)
php artisan view:cache Pre-compile every Blade view
php artisan key:generate Generate a fresh APP_KEY

Where files end up

Action Result lands in…
Boot the app Compiled views in storage/framework/views/
Use the database cache store Rows in cache and cache_locks tables
Use the database session driver Rows in the sessions table
Dispatch a job (default queue connection) Row in jobs; failures move to failed_jobs
Write to Log::* Appended to storage/logs/laravel.log (single channel by default)
npm run build Hashed assets in public/build/
npm run dev A public/hot file pointing Blade at the Vite dev server
Maintenance mode storage/framework/maintenance.php

See Reference → Configuration for the full env var matrix.

Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.

Getting started – Laravel wiki | Factory