Todo App with Laravel 8
Demo: https://phplaravel-664318-2249917.cloudwaysapps.com/
username: [email protected]
password: demodemo
Features
- 2 Models with one-to-many relationship: User & Todo
- 1 form field to create a new todo item (/todo/create)
- 1 'Mailable' Email class on Todo deletion
- Adding deletion emails to the Job Queues (configured with database to see the jobs)
Features that didn't make it into this:
- Removing the childs of a deleted model (wanted to use softdeletes, but ended up just adding a job with email to the queue)
- Deletion through relationship (Deleting user would delete their todos)
- Unit tests
Used lib/tools to build this
- Used Laravel Resources for easy CRUD actions on Todo items
- Laravel Breeze authentication (User model & Auth pages)
- used SMTP with mailhog locally, demo has no smtp-transport configured
- Job Queue with database configuration, so you can keep track of scheduled jobs
- no Redis or Beanstalkd so run the Job queue with php artisan queue:work (demo app uses cron each hour to process)
Installation
- Run
git clone [email protected]:Nav-Appaiya/laravel-todo.git
- Install composer dependencies:
composer install
- create your database, and configure your .env settings with database, email and type of queue configuration
- Run the migration:
php artisan migrate
- Run additional seeding:
php artisan db:seed
- Serve your app and visit your local app-url:
php artisan serve
Routes
URL | Function |
---|---|
/login | Login as user |
/register | Register as user |
/todo | Overview of your todos and other users |
/todo/create | Create a todo |
/todo/{todo_id} | View a todo |