mediamonks/rest-api
A Laravel package from MediaMonks for building REST APIs with a consistent structure and standardized JSON responses. It helps organize controllers, handle errors and validation, and return paginated resources for more predictable API development.
composer require mediamonks/rest-api, then immediately check composer.json for the pinned symfony/http-kernel constraint and PHP version floor — the package tracks HttpKernel tightly, so match it to your runtime before writing code.README.md and examples/ directory first. This is a thin package, so the example front controller is effectively the real documentation: it shows how the router, middleware stack, container, and HttpKernel are assembled.public/index.php: build the router, register middleware, construct the kernel, call $kernel->handle(Request::createFromGlobals()), and ->send() the response. Get that loop returning anything before adding features.GET /health returning {"status":"ok"}. This proves request → middleware → controller → response wiring. Then add one resource route (GET /users/{id}) backed by a controller and a repository.JsonResponse is the core loop. Keep controllers thin: validate input, delegate to a service/repository, return a response. Business logic never belongs in the controller.JsonResponse early) on failure.type, title, status, detail). Do it once so every endpoint — including 404s and validation failures — looks the same..env or container secrets) so both apps read the same DB credentials, JWT secret, Redis host, and CORS allow-list.Request, call $kernel->handle($request), assert against the Response. This is fast, needs no web server, and exercises the full middleware chain.composer require will not "just work" inside a Laravel app.symfony/http-kernel can change the handle()/terminate() signatures and break the kernel. Lock versions in composer.lock and update deliberately.OPTIONS handling in middleware, or browser calls will fail before they ever reach your controller.src/ namespace so you can lift it into Symfony or Laravel if you outgrow the package.How can I help you explore Laravel packages today?