one2tek/larapi
Larapi is a Laravel package for building REST APIs with less boilerplate. It offers convenient response helpers, CRUD-oriented endpoints, and common API patterns so teams can ship consistent JSON APIs faster while staying within Laravel conventions.
one2tek/larapi is a Laravel package for scaffolding REST API layers (routing, controllers, response formatting) on top of a standard Laravel app.
composer require one2tek/larapi:^2.0.11
On Laravel 9 this also means PHP 8.0+; if you are still on Laravel 6/7/8, ^2.0 will resolve to a compatible 2.0.x — check composer why-not if the install refuses.php artisan vendor:publish --provider="One2tek\Larapi\LarapiServiceProvider"
Inspect config/larapi.php first — that file is the map of the package's opinions (route prefix, middleware stack, response wrapping, pagination defaults).GET /api/v1/things endpoint returning the package's standard JSON envelope — and assert it with a Laravel HTTP test. Confirm the envelope shape (data/meta/errors keys) before you build a second endpoint, since every client contract downstream depends on it.routes/api.php thin and group by prefix (/v1, /v2) with the package middleware applied at the group level. This makes the eventual v2 rollout additive rather than a rewrite.respond()/ApiResponse-style method or a Resource collection) so mobile and SPA clients parse one shape. Add a MakeApiResponse-style action or a base ApiController method rather than repeating response()->json([...]).throttle:api in the package's config-driven middleware array rather than on individual routes — you get uniform behaviour and one place to audit.render hook in app/Exceptions/Handler.php (or the Laravel 9 withExceptions closure) that converts ValidationException, ModelNotFoundException, and AuthenticationException into the package's error envelope. Without this you get Laravel's HTML/debug responses leaking into your JSON contract.$this->getJson() / assertJsonStructure() against the envelope so refactors and package upgrades fail loudly. This matters more than usual for a small-maintainer package.composer.lock or a ^2.0.0 constraint copied from an older project can silently resolve to 2.0.10 and fail on Laravel 9 due to framework API differences. After upgrading Laravel, run composer update one2tek/larapi --with-dependencies and verify the installed version.2.0.x line implies semver patch semantics — still, read the changelog before each bump given the low release cadence and single-maintainer history.php artisan config:clear && php artisan route:clear (and optimize:clear in CI) whenever you edit the published config or add a package-provided route file.bootstrap/cache/packages.php, or add the provider manually in config/app.php if you're on an older app skeleton.config/larapi.php at project setup rather than patching vendor code.Log::info() inside package middleware plus Telescope's request/response pair is the fastest way to see where the envelope is being rewritten. dd() inside a response macro will surface as a broken JSON body, not a stack trace.How can I help you explore Laravel packages today?