🐘 Dumbo

Examples

Forty-odd little apps, each doing one thing well. Steal freely. 🐘

Every folder in the examples directory is a small, runnable Dumbo app. Each one has its own composer.json, so you can cd in, run composer install and composer start.

Basic auth ↗ Use Basic authentication in Dumbo. Basic auth custom ↗ Use Basic authentication in Dumbo using a custom verify function. Basic auth multiple users ↗ Use Basic authentication in Dumbo for multiple users. Basic auth nested ↗ Use Basic authentication in Dumbo using nested routes (e.g. /api). Bearer auth ↗ Use bearer authentication in Dumbo. Bearer auth nested route ↗ Use bearer authentication in Dumbo using nested routes (e.g. /api). Benchmark ↗ This example has some basic benchmarks for Dumbo. Body limit ↗ Use a body limit middleware in Dumbo. Compress ↗ Compress responses using gzip or deflate in Dumbo. Context variables ↗ get and set custom variables on the root, and route middleware. Context view Blade ↗ Pass a render closure to context and generate a view using the latte template engine. Context view Latte ↗ Pass a render closure to context and generate a view using the blade template engine. Context view Smarty ↗ Pass a render closure to context and generate a view using the smarty template engine. Context view Twig ↗ Pass a render closure to context and generate a view using the Twig template engine. Cookie auth ↗ Use signed cookies for authentication that uses a database for storing sessions. Cookie JWT auth ↗ Use a JWT to store information about the logged in user. Cookies ↗ Set and read cookies with Dumbo. CORS ↗ Enable CORS in Dumbo. Database pdo ↗ Share a PDO connection with your routes using context middleware, and build a simple CRUD API with prepared statements. Dates ↗ This example demonstrates working with dates in a Dumbo route using PHP's built-in date functions. Docker FrankenPHP ↗ This repository provides a basic example of setting up FrankenPHP in a Docker environment using Dumbo. Docker Nginx ↗ This repository provides a basic example of setting up Nginx in a Docker environment using Dumbo. Docker PHP FPM ↗ This repository provides a basic example of setting up PHP-FPM in a Docker environment using Dumbo. Environment modes ↗ Use different environment modes in Dumbo. HTML ↗ Return HTML with Dumbo. HTMX Blade ↗ Use htmx with Blade and Dumbo. HTTP cache ↗ Use the http cache middleware in Dumbo JSON ↗ Return JSON with Dumbo. JSON TXT files ↗ Return JSON with Dumbo. JWT auth ↗ Use JWT authentication in Dumbo. Logger ↗ Use a logger in Dumbo. Middleware ↗ This example demonstrates how middleware executes in Dumbo. Redirect ↗ Redirect with Dumbo. Request ID ↗ Use a X-Request-Id header with Dumbo for request tracing. Route params ↗ Use route params with Dumbo. Send ↗ Return different types of responses with Dumbo. Simple ↗ A Dumbo example. Static assets ↗ Serve static files with Dumbo. Template Blade ↗ Use the Laravel Blade templating engine to render views and pass them to Dumbo for displaying as HTML pages. Template Latte ↗ Use the Latte templating engine to render views and pass them to Dumbo for displaying as HTML pages. Text ↗ Return text with Dumbo. Turso ↗ Use Turso with Dumbo to build a simple CRUD API. Turso vector ↗ Use Turso's vector similarity search