This guide will walk you through setting up the Zap-Map project on your local development environment.
Before you start, make sure you have the following installed:
- PHP
- Composer
- MySQL
- Laravel CLI
Clone the project repository to your local machine:
download file on https://www.dropbox.com/home/CloudEmploye-Test/zip-location-test
cd zap-map composer install
Step 3: Configure environment variables Duplicate the .env.example file and rename it to .env:
Then, open the .env file and update the database connection settings:
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=your_database_name
DB_USERNAME=your_username
DB_PASSWORD=your_password
php artisan key:generate
Before you can run the migrations and seeders, you will need to create a new MySQL database for the project.
Here's how you can do this:
-
Open your terminal.
-
Log in to the MySQL shell with the following command:
mysql -u root -p
You'll be prompted to enter the password for the root user. If your MySQL server has a different setup, replace root with your MySQL username.
CREATE DATABASE zap_map;
This command creates a new database named zap_map. You can replace zap_map with the name you want to use for your database.
SHOW DATABASES;
You should see zap_map (or the name you chose for your database) in the list of databases.
Remember to update the .env file in your Laravel project with the name of your new database, as well as the username and password for your MySQL server.
php artisan migrate --seed
You should now be able to access the API at http://localhost:8000/api/
php artisan serve