# mevdschee/php-crud-api

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/mevdschee-php-crud-api).**

3,735 stars · 1,031 forks · PHP · MIT

## Links

- GitHub: https://github.com/mevdschee/php-crud-api
- awesome-repositories: https://awesome-repositories.com/repository/mevdschee-php-crud-api.md

## Topics

`api-server` `automatic-api` `crud` `database` `geojson` `geospatial` `multi-database` `mysql` `openapi` `php` `php-api` `postgis` `postgresql` `rest-api` `restful` `sql-database` `sqlite` `sqlserver` `swagger`

## Description

This project is a PHP SQL REST API generator and database API wrapper that automatically transforms SQL database tables into a functional web interface. It serves as a lightweight layer that maps HTTP methods to SQL commands, allowing for the creation, reading, updating, and deletion of records without writing manual endpoint code.

The tool distinguishes itself by providing a dedicated spatial data API gateway for querying and exporting geometry columns using GeoJSON and WKT standards. It also functions as a multi-tenant data API, capable of isolating records for different users through shared columns or separate SQL databases.

Broad capabilities include an interface layer for schema mapping and legacy data restructuring, alongside built-in support for data filtering, pagination, and the retrieval of related data via join paths. The system also supports batch operations, bearer-token authentication, and the ability to extend endpoints through custom controller classes.

The application is available as a single-file distribution and can be deployed via Docker.

## Tags

### Data & Databases

- [Database-to-REST Interfaces](https://awesome-repositories.com/f/data-databases/database-to-rest-interfaces.md) — Automatically generates RESTful API endpoints directly from database schemas and table structures. ([source](https://github.com/mevdschee/php-crud-api/blob/master/extras/core.php))
- [HTTP-to-SQL Mappers](https://awesome-repositories.com/f/data-databases/http-to-sql-mappers.md) — Translates incoming REST method calls directly into corresponding SQL queries to automate database operations.
- [CRUD Operations](https://awesome-repositories.com/f/data-databases/crud-operations.md) — Implements standard operations for creating, reading, updating, and deleting records within a SQL database. ([source](https://github.com/mevdschee/php-crud-api/blob/main/README.md))
- [Spatial Querying](https://awesome-repositories.com/f/data-databases/data-querying/spatial-querying.md) — Provides spatial querying capabilities to filter geometry columns using WKT and GeoJSON standards. ([source](https://github.com/mevdschee/php-crud-api#readme))
- [Criteria-Based Record Filtering](https://awesome-repositories.com/f/data-databases/data-querying/table-item-filters/numeric-range-filters/criteria-based-record-filtering.md) — Refines database record lists using string patterns, numeric comparisons, and criteria-based filters. ([source](https://github.com/mevdschee/php-crud-api#readme))
- [Dynamic Query Generation](https://awesome-repositories.com/f/data-databases/database-management-systems/database-systems-management/database-operations/sql-query-execution/dynamic-sql-query-executions/dynamic-query-generation.md) — Constructs SQL statements at runtime based on URL parameters for filtering, sorting, and pagination.
- [Record Updates](https://awesome-repositories.com/f/data-databases/database-record-management/record-updates.md) — Implements the ability to modify existing SQL database records via RESTful web requests. ([source](https://github.com/mevdschee/php-crud-api/blob/main/update.php))
- [Relational Record Fetching](https://awesome-repositories.com/f/data-databases/database-record-querying/relational-record-fetching.md) — Retrieves nested resources and associated records by specifying relationship paths in the request. ([source](https://github.com/mevdschee/php-crud-api/blob/main/README.md))
- [Database-to-HTTP Wrappers](https://awesome-repositories.com/f/data-databases/database-to-http-wrappers.md) — Provides a lightweight abstraction layer mapping database operations directly to HTTP request handlers.
- [GeoJSON Exporters](https://awesome-repositories.com/f/data-databases/geojson-generators/geojson-exporters.md) — Exports database geometry columns as standard GeoJSON features with bounding box filtering. ([source](https://github.com/mevdschee/php-crud-api#readme))
- [Multi-Tenant Data Management](https://awesome-repositories.com/f/data-databases/multi-tenant-data-management.md) — Provides a structural system for managing and isolating multi-tenant data at the database level. ([source](https://github.com/mevdschee/php-crud-api/blob/main/README.md))
- [Related Object Retrievers](https://awesome-repositories.com/f/data-databases/relational-data-models/related-object-retrievers.md) — Provides mechanisms for fetching associated database records to produce nested objects based on relations. ([source](https://github.com/mevdschee/php-crud-api#readme))
- [Relational Join Engines](https://awesome-repositories.com/f/data-databases/relational-join-engines.md) — Combines data from multiple tables based on shared columns using filters passed via URL parameters. ([source](https://github.com/mevdschee/php-crud-api/blob/main/examples/clients/firebase/vanilla-success.html))
- [Relational Join Mappers](https://awesome-repositories.com/f/data-databases/relational-join-mappers.md) — Retrieves nested related data by parsing specific join paths in the request to automate SQL joins.
- [Spatial Data APIs](https://awesome-repositories.com/f/data-databases/spatial-data-apis.md) — Provides a dedicated gateway for querying and exporting SQL geometry columns using GeoJSON and WKT.
- [Multi-Tenant API Gateways](https://awesome-repositories.com/f/data-databases/tenant-configurations/per-tenant-override-apis/multi-tenant-api-gateways.md) — Provides an API gateway that uses tenant identifiers to isolate data and configuration access.
- [API Pagination and Sorting](https://awesome-repositories.com/f/data-databases/api-pagination-and-sorting.md) — Controls the number of records returned per page and defines the sort order of results. ([source](https://github.com/mevdschee/php-crud-api/blob/main/README.md))
- [Database Atomic Batches](https://awesome-repositories.com/f/data-databases/bulk-data-operations/atomic-batch-operations/database-atomic-batches.md) — Groups multiple database mutations into a single atomic operation using transactions to ensure consistency. ([source](https://github.com/mevdschee/php-crud-api#readme))
- [Database Schema Mapping](https://awesome-repositories.com/f/data-databases/database-schema-mapping.md) — Maps internal database tables and columns to clean, external API endpoints. ([source](https://github.com/mevdschee/php-crud-api#readme))
- [Full Text Search](https://awesome-repositories.com/f/data-databases/full-text-search.md) — Implements global wildcard searching across text fields in SQL tables. ([source](https://github.com/mevdschee/php-crud-api#readme))
- [JSON API Servers](https://awesome-repositories.com/f/data-databases/json-api-servers.md) — Exposes database contents through a structured JSON interface for programmatic access.
- [Rapid Prototyping Tools](https://awesome-repositories.com/f/data-databases/rapid-prototyping-tools.md) — Accelerates backend development by generating APIs directly from database schema definitions.
- [Result Ordering and Limiting](https://awesome-repositories.com/f/data-databases/result-ordering-and-limiting.md) — Limits the number of returned records and defines the sort order of the results for large datasets. ([source](https://github.com/mevdschee/php-crud-api#readme))
- [Schema Mapping Layers](https://awesome-repositories.com/f/data-databases/schema-mapping-layers.md) — Rename database tables and columns to create a clean interface for legacy data structures. ([source](https://github.com/mevdschee/php-crud-api/blob/main/README.md))
- [Search Result Filtering](https://awesome-repositories.com/f/data-databases/search-result-filtering.md) — Provides mechanisms to apply constraints and filters to database results via API parameters. ([source](https://github.com/mevdschee/php-crud-api/blob/main/README.md))
- [Field Alias Mapping](https://awesome-repositories.com/f/data-databases/structured-data-schemas/field-alias-mapping.md) — Provides field alias mapping to decouple external API field names from internal database column names. ([source](https://github.com/mevdschee/php-crud-api/blob/main/docker-compose.yml))

### DevOps & Infrastructure

- [Database REST APIs](https://awesome-repositories.com/f/devops-infrastructure/api-service-management/api-management/database-rest-apis.md) — Provides automatically generated RESTful endpoints that grant programmatic access to database records. ([source](https://github.com/mevdschee/php-crud-api#readme))

### Scientific & Mathematical Computing

- [Spatial Geometry Types](https://awesome-repositories.com/f/scientific-mathematical-computing/data-modeling-processing/geospatial-and-location-services/spatial-data-processing/spatial-geometry-libraries/spatial-geometry-types.md) — Handles spatial data by representing and filtering geometry columns using WKT and GeoJSON standards. ([source](https://github.com/mevdschee/php-crud-api/blob/main/README.md))

### Security & Cryptography

- [Multi-Tenant Data Isolation](https://awesome-repositories.com/f/security-cryptography/multi-tenant-data-isolation.md) — Isolates user data using either dedicated database connections or shared tables filtered by tenant identifiers.
- [Column and Table Access Restrictions](https://awesome-repositories.com/f/security-cryptography/access-control/panel-access-controls/workspace-access-restrictions/relation-access-restrictions/column-and-table-access-restrictions.md) — Controls access to specific database tables, columns, or records via custom handler functions. ([source](https://github.com/mevdschee/php-crud-api#readme))
- [Bearer Token Authentication](https://awesome-repositories.com/f/security-cryptography/bearer-token-authentication.md) — Provides secure data access by validating bearer tokens passed in HTTP request headers.
- [Request Access Restrictions](https://awesome-repositories.com/f/security-cryptography/domain-access-restrictions/request-access-restrictions.md) — Validates bearer tokens in HTTP headers to authorize requests and restrict API access. ([source](https://github.com/mevdschee/php-crud-api/blob/main/examples/clients/firebase/vanilla-success.html))
- [Input Validation & Sanitization](https://awesome-repositories.com/f/security-cryptography/input-validation-sanitization.md) — Enforces type rules and validation logic to sanitize input before it is stored in the database. ([source](https://github.com/mevdschee/php-crud-api#readme))
- [Request Authentications](https://awesome-repositories.com/f/security-cryptography/network-access-control/request-authentications.md) — Secures API access by verifying user identity via bearer tokens in HTTP request headers. ([source](https://github.com/mevdschee/php-crud-api#readme))

### Software Engineering & Architecture

- [Schema Abstraction Layers](https://awesome-repositories.com/f/software-engineering-architecture/schema-abstraction-layers.md) — Decouples external API field names from internal database column names through a configurable mapping layer.
- [Server Capability Extenders](https://awesome-repositories.com/f/software-engineering-architecture/integration-extensibility/extensibility/plugin-architectures/developer-authoring-interfaces/custom-module-implementations/module-functionality-extenders/cluster-functionality-extenders/server-capability-extenders.md) — Supports adding specialized server-side logic by registering custom controllers into the routing system. ([source](https://github.com/mevdschee/php-crud-api#readme))

### Web Development

- [Dynamic REST API Generators](https://awesome-repositories.com/f/web-development/api-management-tools/api-development-management/api-generation/dynamic-rest-api-generators.md) — Translates database operations into RESTful endpoints at runtime without manual coding.
- [API Gateways](https://awesome-repositories.com/f/web-development/rest-api-backends/api-gateways.md) — Acts as an entry point that routes requests and generates secure endpoints from the underlying spatial database.
- [Custom API Endpoints](https://awesome-repositories.com/f/web-development/custom-api-endpoints.md) — Allows the extension of the API surface area by implementing custom controller classes for new routes. ([source](https://github.com/mevdschee/php-crud-api/blob/main/README.md))
