Getting Started

Prerequisites #

The Laravel framework has a few system requirements. Of course, all of these requirements are satisfied by the Laravel Homestead virtual machine, so it's highly recommended that you use Homestead as your local Laravel development environment.

However, if you are not using Homestead, you will need to make sure your server meets the following requirements:

  • PHP >= 8.2
  • BCMath PHP Extension
  • Ctype PHP Extension
  • Fileinfo PHP extension
  • JSON PHP Extension
  • Mbstring PHP Extension
  • OpenSSL PHP Extension
  • PDO PHP Extension
  • Tokenizer PHP Extension
  • XML PHP Extension
  • Composer

    Make sure you have the Composer installed & running on your computer. If you already have installed Composer on your computer, you can skip this step.

  • Node.js

    In order to use build tools you will need to download and install Node.js. If you do not have Node.js installed already, you can get it by downloading the package installer from the official website. Please download the stable version of Node.js (LTS).

Installation

You can run the following commands to run project locally or build for production use:

You can run this app following package manager: Bun, Yarn or NPM

1. Bun

If you don't have bun installed on your PC, use the npm i -g bun or sudo npm i -g bun to install

Command Description
bun i
This would install all required dependencies in node_modules folder.
bun dev Runs the project locally, starts the development server.
bun run build It bundles with production mode. Your app is now ready to be deployed.
2. Yarn

If you don't have yarn installed on your PC, use the next command npm i -g yarn or sudo npm i -g yarn

Command Description
yarn
This would install all required dependencies in node_modules folder.
yarn dev Runs the project locally, starts the development server.
yarn build It bundles with production mode. Your app is now ready to be deployed.
3. NPM

npm comes preinstalled when you install Nodejs

Command Description
npm i or npm i --force
This would install all required dependencies in node_modules folder.
npm run dev Runs the project locally, starts the development server.
npm run build It bundles with production mode. Your app is now ready to be deployed.

To spin up the Laravel development server, follow the below mentioned steps in a separate terminal:

Command Description
composer i
This will install all required dependencies in vendor folder.
cp .env.example .env This will copy .env.example as .env file.
php artisan key:generate This will generate a unique key and write it in your .env file
php artisan migrate
This will execute all pending migrations to database.
php artisan db:seed
Creates a dummy user into your database for authentication
php artisan serve
Runs the project locally, starts the development server on http://127.0.0.1:8000.