Getting Started
- Required:
- php8.0
- composer
- mysql (or any DB supported by Laravel)
- clone repositories
git clone git@github.com:petrina/firstproject.git
- Create DataBase
I use mysql
mysql -u {DB_USERNAME} -p
and
CREATE DATABASE {DB_DATABASE}
You can use something else.
- Fill Config
Fill next params in .env file:
- DB_CONNECTION
- DB_DATABASE
- DB_USERNAME
- DB_PASSWORD
and change
QUEUE_CONNECTION=database
- Migration
Fill DataBase next command:
php artisan migrate
To start web you need execute
php artisan serve --port=8000
To start worker execute
php artisan queue:work
Use some REST client (like Postman) you can use REST API requests to address
http://localhost:8000/api/posts
Use next address to put parsing in queue
http://127.0.0.1:8000/setqueue
if this your first running
docker-compose up
after this open new terminal and execute
docker exec -it firstproj bash
php artisan migrate
exit
You can use next address
http://0.0.0.0:8000/api/posts
http://localhost:8000/api/documentation/
if you want easy use db then insert
http://0.0.0.0:8080