LinuxCommandLibrary

laravel

Manage and create Laravel projects

TLDR

Create a new Laravel application

$ laravel new [name]
copy

Use the latest development release
$ laravel new [name] --dev
copy

Overwrite if the directory already exists
$ laravel new [name] --force
copy

Install the Laravel Jetstream scaffolding
$ laravel new [name] --jet
copy

Install the Laravel Jetstream scaffolding with a specific stack
$ laravel new [name] --jet --stack [livewire|inertia]
copy

Install the Laravel Jetstream scaffolding with support for teams
$ laravel new [name] --jet --teams
copy

List the available installer commands
$ laravel list
copy

SYNOPSIS

laravel new [<version>:]^<name> [options...]
laravel info
laravel list
laravel [--version | --help]

PARAMETERS

new
    Create a new Laravel application

--api
    Install with API preset (includes Sanctum)

--auth
    Scaffold Breeze authentication

--dev
    Include development dependencies

--force, -f
    Overwrite existing application

--offline, -o
    Skip Composer cache update

--pest
    Install Pest testing framework

--pest-plugin
    Add Pest plugin for Artisan

--preferred
    Use --prefer-dist in Composer

--qr
    Add QR code scanning support

--server
    Install server-side rendering support

--stack=livewire|inertia
    Use specified frontend stack

--test=phpunit|pest
    Choose testing framework

--type=project
    Specify project type (e.g., api)

info
    Display Laravel Installer information

list
    List available stubs and recipes

--version, -V
    Show installer version

--help, -h
    Show help

DESCRIPTION

The laravel command is the official CLI tool from the Laravel Installer package, a popular PHP web application framework created by Taylor Otwell. It simplifies creating new Laravel projects by automating setup of dependencies, configuration files, and optional features like authentication or testing frameworks.

Install globally with composer global require laravel/installer, ensuring Composer's vendor/bin is in your $PATH. Primary usage: laravel new project-name, which creates a fresh app in a new directory, installs via Composer, generates app key, and optionally inits Git.

Supports specifying versions like laravel new:^11.0 myapp. Options enable stacks (Livewire/Inertia), API presets, Pest testing, Breeze auth, QR codes, or SSR. Additional commands: laravel info (installer details) and laravel list (available stubs/recipes).

Ideal for developers starting projects quickly, it handles boilerplate, ensuring best practices from Laravel's ecosystem. Requires PHP 8.2+ and Composer.

CAVEATS

Requires PHP 8.2+, Composer (global install), and $PATH including ~/.composer/vendor/bin. Not a core Linux utility; framework-specific. Offline mode skips updates. Version pinning uses caret syntax like ^11.0.

INSTALLATION

Run composer global require laravel/installer. Add export PATH="$HOME/.composer/vendor/bin:$PATH" to ~/.bashrc or ~/.zshrc.

UPDATING

composer global update laravel/installer for latest features and stubs.

POST-INSTALL

After laravel new, run cd project && php artisan key:generate if needed; php artisan serve starts dev server.

HISTORY

Introduced in Laravel 5.5 (August 2017) to replace complex composer create-project setups. Evolved with framework versions: supports Laravel 11+ stacks, Pest, Inertia. Maintained via Composer by Laravel team; key for modern onboarding since PHP 7.3 era.

SEE ALSO

composer(1), php(1), git(1)

Copied to clipboard