- Setting up queues would be necessary to run background task
- setup database and run migrations to migrate all table
- Run seeders per class basis ie.
db:seed --class=[seeder]
rather than callingdb:seed
- After dummy data will be inserted into the database
-
POST http://127.0.0.1:8000/api/site/{site}/posts -- create posts for a particular website
"title": "ddkkdsadxch", "description": "fsdafd" }
{ "data": { "title": "ddkkdsadxch", "slug": "ddkkdsadxch", "description": "fsdafd", "site_id": 1, "updated_at": "2021-11-16T07:12:03.000000Z", "created_at": "2021-11-16T07:12:03.000000Z", "id": 30 } }
-
POST http://127.0.0.1:8000/api/site/{site}/subscribe -- subscribes a user to a plan on a site
"user_id": 2, "plan_id": 30 }
"data": { "plan_id": 3, "site_id": 8, "starts_on": "2021-11-16T07:57:33.465906Z", "user_id": 2, "updated_at": "2021-11-16T07:57:33.000000Z", "created_at": "2021-11-16T07:57:33.000000Z", "id": 13 } }
-
GET http://127.0.0.1:8000/api/site/{site}/subscribers -- get users subscribed on a set
"data": { "id": 1, "name": "Vincenza Ebert Jr.", "slug": "vincenza-ebert-jr", "created_at": "2021-11-16T04:45:53.000000Z", "updated_at": "2021-11-16T04:45:53.000000Z", "subscribers": [ { "id": 1, "name": "Verdie Kozey IV", "email": "hayes.maxwell@example.com", "email_verified_at": "2021-11-16 04:45:53", "created_at": "2021-11-16T04:45:53.000000Z", "updated_at": "2021-11-16T04:45:53.000000Z", "pivot": { "site_id": 1, "user_id": 1 } }, { "id": 2, "name": "Maybelle Veum", "email": "hertha.block@example.org", "email_verified_at": "2021-11-16 04:45:53", "created_at": "2021-11-16T04:45:53.000000Z", "updated_at": "2021-11-16T04:45:53.000000Z", "pivot": { "site_id": 1, "user_id": 2 } } ] } }
## Mail setup
1. used mailtrap to setup emails to subscribers
## Events
Since this was smaller project all events were run from the booted methods of the model