Наше приложение поможет вам с рецептом блюд на каждай день!
Installation:
- Install dependencies
composer install
- Create new database
CREATE DATABASE recipe_db;
USE recipe_db;
CREATE TABLE users(
id INTEGER PRIMARY KEY AUTO_INCREMENT,
name VARCHAR(255),
telegram_id INT,
first_name VARCHAR(255),
last_name VARCHAR(255),
chat_id INT,
created_at DATETIME default CURRENT_TIMESTAMP,
updated_at DATETIME,
deleted_at DATETIME
);
CREATE TABLE Mail(
id INTEGER PRIMARY KEY AUTO_INCREMENT,
letter VARCHAR(255),
created_at DATETIME default CURRENT_TIMESTAMP
);
- Put the database information in env file
DB_NAME="recipe_db"
DB_HOST="localhost"
DB_USER="root"
DB_PASSWORD="zhanarys"
- Run the project
php -S localhost:8080
- Test crontab by opening
crontab -e
- Writing the task down
1 * * * * cd /path-to-our-github/recipe-sender-php-microservice/ && php -f script.php
- Saving and starting crontab
CTRL (CMD)+ X
CTRL (CMD)+ Y