Step 1: Laravel Setup

  1. Go into the directory of the 'backend', by using the command line interface. like below at the mapmama directory.

cd backend
  1. Execute 'php artisan migrate' to run database migrations and set up the database schema.

php artisan migrate
  1. If you encounter an error similar to the one shown in the provided image, indicating the absence of the 'vendor' directory, it signifies missing dependencies.

Error Console

To resolve this issue, run 'composer install' in the terminal to retrieve and install the necessary dependencies.

composer install

WHY THIS HAPPEN? When performing a 'git pull', due to the specified patterns in the .gitignore file, the 'vendor' directory, which contains dependencies, won't be included.

Btw, it is always suggesting not to including the vendor into git push because vendor is mostly large and easy to occur conflict the merge, then it is more easy just composer install when git clone the project.

Therefore, it's essential to execute 'composer install' beforehand to ensure all dependencies are retrieved and installed properly.

Now, do the 'php artisan migrate' again and it should work.

  1. Execute 'php artisan serve' to start the PHP development server.

php artisan serve

Laravel is success run in your local environment when you see the output like below

Output of 'php artisan serve'

Last updated