DEV Community

Thaqif Rosdi
Thaqif Rosdi

Posted on

what to do after clone git hub repo for laravel

making this one because i keep on forgetting how..

After cloning a Laravel project from GitHub, follow these steps to set it up:

1. Navigate to the Project Directory

cd your-project-folder
Enter fullscreen mode Exit fullscreen mode

2. Install Dependencies

Run Composer to install PHP dependencies:

composer install
Enter fullscreen mode Exit fullscreen mode

If your project uses Node.js, install frontend dependencies:

npm install
Enter fullscreen mode Exit fullscreen mode

3. Set Up Environment File

Copy the example .env file:

cp .env.example .env
Enter fullscreen mode Exit fullscreen mode

Then, open .env and configure your database settings.

4. Generate Application Key

php artisan key:generate
Enter fullscreen mode Exit fullscreen mode

5. Set Up Database

Ensure your .env file has the correct database credentials, then run:

php artisan migrate --seed
Enter fullscreen mode Exit fullscreen mode

(--seed is optional if your project includes seeders.)

6. Set File Permissions (if needed)

chmod -R 775 storage bootstrap/cache
Enter fullscreen mode Exit fullscreen mode

7. Serve the Application

php artisan serve
Enter fullscreen mode Exit fullscreen mode

8. (Optional) Build Frontend Assets

If your project uses Vite:

npm run dev
Enter fullscreen mode Exit fullscreen mode

The step is easy enough, but sometimes..as a human; we are forgetful.

Top comments (0)