The LDOG Stack for PHP
Laravel, Doctrine ORM, and GraphQL
#
This is a template application for building GraphQL applications in Laravel with Doctrine ORM. Known as the LDOG (el-dog) Stack.
To create a new project run
Source code available at https://github.com/api-skeletons/ldog
This site is the ldog project running on Google Cloud. It includes an example Doctrine ORM schema and database served as GraphQL.
You may explore the GraphQL with graphiql or POST to this server's GraphQL endpoint at https://ldog.apisketons.dev
Features
#
- Dockerfile suitable to immediate deployment to Cloud Run
- docker-compose.yml file - no Laravel Sail integration
- Doctrine ORM configured for XML metadata and no database naming strategy
- Includes the api-skeletons/doctrine-orm-graphql type driver
- The GraphQLController is pre-configured with example endpoints for connection, entity, and mutation
- The Doctrine entities have default configuration for api-skeletons/doctrine-orm-graphql
- Authorization provided by api-skeletons/laravel-doctrine-apikey and laravel/passort
- The Laravel code has been modified so the entire project passes the Doctrine Coding Standard
- Code quality tools include parallel-lint, phpcs, psalm, and phpunit
- An unit test is included that tests the GraphQL endpoints
Why use this template application?
#
This template application is based on Laravel 10.x. Nothing has been taken away from that default Laravel release but a lot has been added.
There are many GraphQL solutions available including those that integrate with Laravel and Eloquent. But Doctrine ORM is the superior ORM because it is a data mapper pattern .
The doctrine-orm-graphql library creates the types for your Doctrine entities and has numerous other features.
A Skipper diagram is included and the example database metadata is exported from it as XML. The advantages of XML metadata over annotations or attributes are many and not needing to edit the XML manually is a big benefit.
Convert an existing database to GraphQL
#
Using skipper, import a new external model and import your database. Change the
Export Data Format to XML and set the path to ~/config/doctrine-orm-metadata
.
Export from Skipper and build your entities. Turn on globalEnable
in the driver
and create at least one endpoint.
Support
#
Support for this template application is available through API Skeletons .
Getting Started