This repository is a small platform, to which the USER can subscribe to a special website. When the new post was published on the website, the subscriber will receive an email to notify with the post title and post content.
- Use PHP 7.* (i.e. use Laravel 8 as Laravel 9 requires PHP 8.0)
- Write migrations for the required tables.
- Endpoint to create a "post" for a "particular website".
- Endpoint to make a user subscribe to a "particular website" with all the tiny validations included in it.
- Use of the command to send email to the subscribers.
- Use of queues to schedule sending in the background.
- No duplicate stories should get sent to subscribers.
Database schema: https://pasteboard.co/9128d1zO4QLs.png
composer install
Setup environment
cp .env.example .env
Remember change information of database,base url, smtp...
php artisan migrate
php artisan db:seed
Postman: https://www.postman.com/tuanhaviet22/workspace/inisev
Execute manually via CLI:
php artisan inisev:send
Note: This app using Google Gmail App is SMTP, so you need to account and password to using send mail function. I put demo account in .env.example
MAIL_MAILER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
[email protected]
MAIL_PASSWORD=oidqtacpcoqvfsvt
MAIL_ENCRYPTION=tls
MAIL_FROM_NAME="${APP_NAME}"