Skip to content

Example API project demonstrating usage of the Laravel-Doctrine-ODM wrapper

Notifications You must be signed in to change notification settings

chefsplate/laravel-doctrine-odm-example

Repository files navigation

laravel-doctrine-odm-example [WIP]

Example Laravel project demonstrating usage of the Laravel-Doctrine-ODM wrapper for creating an API for a todo list service, similar to Todoist!

Entities can be found under app/Entities, and API endpoints can be found in app/Http/Controllers.

Requirements

Install

Install this example by typing

composer install

at the root of the project.

Configure the Mongo connection within config/database.php to point to your Mongo instance:

'mongodb' => array(
    'driver'   => 'mongodb',
    'dsn'      => 'mongodb://127.0.0.1:27017',
    'database' => 'todos'
),

More installation details are available on the Laravel-Doctrine-ODM wrapper project page if you are setting this up on your existing projects.

Data model

  • Users have projects (we will create an inbox)
  • Projects have tasks
  • Tasks have description, notes, labels, due date and status

API

In this example, we will implement the following operations:

Request Type Operation
GET Users can fetch their projects and tasks
POST Users can create tasks within a project (e.g. Inbox)
PUT Users can mark a task as complete
DELETE Users can delete a task
GET Users can get a list of all incomplete tasks due in next 7 days (Today view)

Note: This example is a work-in-progress.

About

Example API project demonstrating usage of the Laravel-Doctrine-ODM wrapper

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages