This guide will help you set up a Laravel project after cloning or pulling from a remote repository.
Make sure you have the following installed on your machine:
- PHP 8.2
- Composer 2.8
- npm 10.9
- node.js 22.12
-
Clone the repository
git clone <repository-url> cd <repository-directory>
-
Install PHP dependencies
composer update
-
Install Node.js dependencies
npm install
-
Set up environment variables
Copy the
.env.examplefile to.env:cp .env.example .env
Generate the application key:
php artisan key:generate
Update the
.envfile with your database and other configurations. -
Run database migrations
php artisan migrate
-
Run the development server
php artisan serve
-
Compile assets
npm run dev
If you pull new changes from the remote repository, you may need to update your dependencies.
-
Update PHP dependencies
composer update
-
Update Node.js dependencies
npm update
-
Run database migrations
php artisan migrate
-
Compile assets
npm run dev
You should now be able to run the Laravel application with the latest changes.