- PHP ^8.0
- Composer
- Laravel 11
- Laravel Valet (optional, for local development with Valet)
-
Clone the repository to your local machine
git clone https://github.com/ogunsakin01/mkm.git
-
Change into the project directory
cd mkm
-
Install project dependencies using Composer:
composer install
-
Copy the
.env.example
file to create a new.env
filecp .env.example .env
-
Generate the application key
php artisan key:generate
-
Generate JWT secret using this command below
php artisan jwt:secret
-
Create a database in your local environment and update the database connection settings in the
.env
file according to your database setupDB_CONNECTION=**** DB_HOST=**** DB_PORT=**** DB_DATABASE=**** DB_USERNAME=**** DB_PASSWORD=****
-
Run database migrations and seed the database
php artisan migrate
-
Clear the application cache
php artisan optimize:clear
- To start the application, you can use the built-in Laravel development server:
php artisan serve
- Or you can directly use PHP built-in server:
php -S localhost:8000 -t public/
- If you choose to use Laravel Valet, run the command below to have it available at http://mkm.test:
valet link
- Or if you wish to test locally with SSL, run the command below to have it available at https://mkm.test:
valet secure
-
Setup you queue connection in the env file to database
QUEUE_CONNECTION=database
-
The import process makes use of Jobs and queues. To start the queue worker, run:
php artisan queue:listen
-
Ensure the file to export is named products.csv and is in the public directory. This CSV file must also have the headers: name, sku, brand, and description.
-
If this condition has been met, proceed to access the route
http://127.0.0.1:8000/import
, and the entire process will run in the background.
- You can find the API documentation here.