Laravel - Create New Laravel V10 Project

Laravel v.10.3.2, PHP v.8.2.11, Composer v.2.4.1, PHP Artisan v.10.48.4

[1] Using Composer Command

Create a Laravel project with a specific project-name:

composer create-project --prefer-dist laravel/laravel project-name

Create a Laravel project with specific project-name and framework-version:

composer create-project --prefer-dist laravel/laravel:^10.3.2 project-name

[2] Using Laragon

Right-click the Laragon Control Panel, select context menu Quick_app/Laravel

Enter project name:

Laragon will automatically run composer that creates a Laravel project with latest version (ensure that your selected PHP version supports this version).

You may also specify the version by modifying the configuration. Right-click the Laragon Control Panel, select context menu Quick_app/Configuration...:

In the following example, the version is set to 10.3.2. Refer the Laravel Releases page for the version numbers that you may require.

[3] Post Installation Check

The (Laragon default) terminal will output a success message as follows:

Check versions:

C:\laragon\www\razzi
λ composer --version
Composer version 2.4.1 2022-08-20 11:44:50

C:\laragon\www\razzi
λ composer show laravel/framework | grep "versions"
versions : * v10.48.4

C:\laragon\www\razzi
λ php artisan --version
Laravel Framework 10.48.4

Go into the project root folder and check composer.json and package.json

File C:\laragon\www\razzi\composer.json :

{
    "name": "laravel/laravel",
    "type": "project",
    "description": "The skeleton application for the Laravel framework.",
    "keywords": ["laravel", "framework"],
    "license": "MIT",
    "require": {
        "php": "^8.1",
        "guzzlehttp/guzzle": "^7.2",
        "laravel/framework": "^10.10",
        "laravel/sanctum": "^3.3",
        "laravel/tinker": "^2.8"
    },
    "require-dev": {
        "fakerphp/faker": "^1.9.1",
        "laravel/pint": "^1.0",
        "laravel/sail": "^1.18",
        "mockery/mockery": "^1.4.4",
        "nunomaduro/collision": "^7.0",
        "phpunit/phpunit": "^10.1",
        "spatie/laravel-ignition": "^2.0"
    },
    "autoload": {
        "psr-4": {
            "App\\": "app/",
            "Database\\Factories\\": "database/factories/",
            "Database\\Seeders\\": "database/seeders/"
        }
    },
    "autoload-dev": {
        "psr-4": {
            "Tests\\": "tests/"
        }
    },
    "scripts": {
        "post-autoload-dump": [
            "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
            "@php artisan package:discover --ansi"
        ],
        "post-update-cmd": [
            "@php artisan vendor:publish --tag=laravel-assets --ansi --force"
        ],
        "post-root-package-install": [
            "@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
        ],
        "post-create-project-cmd": [
            "@php artisan key:generate --ansi"
        ]
    },
    "extra": {
        "laravel": {
            "dont-discover": []
        }
    },
    "config": {
        "optimize-autoloader": true,
        "preferred-install": "dist",
        "sort-packages": true,
        "allow-plugins": {
            "pestphp/pest-plugin": true,
            "php-http/discovery": true
        }
    },
    "minimum-stability": "stable",
    "prefer-stable": true
}

File C:\laragon\www\razzi\package.json :

{
    "private": true,
    "type": "module",
    "scripts": {
        "dev": "vite",
        "build": "vite build"
    },
    "devDependencies": {
        "axios": "^1.6.4",
        "laravel-vite-plugin": "^1.0.0",
        "vite": "^5.0.0"
    }
}

File C:\laragon\www\razzi\.env:

APP_NAME=Laravel
APP_ENV=local
APP_KEY=base64:pTUrJhxMY0h5+RR6lMWNN9Hg1PcLqjULILvXkL++ZkU=
APP_DEBUG=true
APP_URL=http://localhost

LOG_CHANNEL=stack
LOG_DEPRECATIONS_CHANNEL=null
LOG_LEVEL=debug

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=laravel
DB_USERNAME=root
DB_PASSWORD=

BROADCAST_DRIVER=log
CACHE_DRIVER=file
FILESYSTEM_DISK=local
QUEUE_CONNECTION=sync
SESSION_DRIVER=file
SESSION_LIFETIME=120

MEMCACHED_HOST=127.0.0.1

REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379

MAIL_MAILER=smtp
MAIL_HOST=mailpit
MAIL_PORT=1025
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
MAIL_FROM_ADDRESS="hello@example.com"
MAIL_FROM_NAME="${APP_NAME}"

AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_DEFAULT_REGION=us-east-1
AWS_BUCKET=
AWS_USE_PATH_STYLE_ENDPOINT=false

PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=
PUSHER_HOST=
PUSHER_PORT=443
PUSHER_SCHEME=https
PUSHER_APP_CLUSTER=mt1

VITE_APP_NAME="${APP_NAME}"
VITE_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
VITE_PUSHER_HOST="${PUSHER_HOST}"
VITE_PUSHER_PORT="${PUSHER_PORT}"
VITE_PUSHER_SCHEME="${PUSHER_SCHEME}"
VITE_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"

You may need the above information for future use e.g. recreating the project etc.

By default, Laravel v.10 sets the database connection to mysql.

For development purpose, you may want to change to sqlite as follows:

DB_CONNECTION=sqlite
# DB_HOST=127.0.0.1
# DB_PORT=3306
# DB_DATABASE=laravel
# DB_USERNAME=root
# DB_PASSWORD=

Browse the page at razzi.test

Or, alternative URL http://localhost/razzi/public:

Download example:

https://archive.org/download/laravelprojects/razzi_20240331_laravel10_new_project.zip