- How do I install Metapi in a Laravel application?
- Install it with Composer using composer require acidjazz/metapi. Metapi follows the standard Laravel package pattern: service provider registration and a publishable configuration file. Publish the config, then enable it against one non-critical model first. Check the generated routes and JSON payloads before rolling it out more widely.
- Which Laravel and PHP versions does Metapi support?
- Version 2.4.0 adds Laravel 12.x compatibility, and the package targets modern PHP. The changelog signal is forward-looking, so do not assume support for older Laravel LTS releases unless the Composer constraints and CI matrix confirm it. Verify the composer.json constraints and whether a Laravel 12 job actually runs in CI. If you are pinned to Laravel 10 or 11, test on a branch before adopting.
- What features does Metapi provide beyond metadata management?
- Metapi provides Laravel API helpers for managing application metadata, benchmarking, and interactive API browsing. You can define and organize metadata such as page details, SEO tags, or custom model metadata, then expose it in views, controllers, or JSON responses. The package layers convention-driven API behavior onto Eloquent models. Confirm the exact feature set in the package config and README for your version.
- Is Metapi suitable for public-facing APIs?
- Treat public exposure carefully. Any package that derives routes and payloads from Eloquent models can expose columns or relationships that were never meant for external use. That risk is configuration-shaped, so a normal test run may not catch it. Audit the generated route table, serialized fields, and authorization layer before exposing endpoints publicly.
- How do I limit which Eloquent models and columns Metapi exposes?
- Because Metapi derives API surface from models, scope is controlled through configuration and model visibility rather than by accident. Start with a single non-critical model, inspect the generated route table and JSON output, and use Eloquent hidden and visible settings or explicit resource shaping where needed. Review relationships as well as columns. Widen the model scope only after confirming nothing sensitive is serialized.
- How should I enforce authorization on Metapi-generated endpoints?
- Metapi is not a replacement for your application's authorization layer. Enforce access with Laravel middleware, policies, or route-group guards in front of any generated endpoints. Review every generated route as you would a hand-written controller. If the API is internal, still document who can reach it and what each endpoint returns.
- Can I use Metapi on Laravel 10 or 11?
- The v2.4.0 release is explicitly about adding Laravel 12.x compatibility, and the evaluation found no stated support window for older releases. Laravel 10 or 11 may work with earlier package versions, but that is not proven by the changelog. Check the Composer constraints for the version you plan to install and run your test suite on a branch. Pin the version if you need stability on an older framework major.
- How do I test a Metapi integration safely before production?
- Install Metapi on a throwaway branch, publish the config, and enable it for one non-critical model. Run php artisan route:list to inspect generated endpoints and call them to review JSON payloads. Add tests for authentication, authorization, and field exposure, then run your existing suite. Review the v2.4.0 diff before upgrading so you know whether it changes only constraints or code paths.
- Is Metapi actively maintained and safe for long-term use?
- Maintenance concentration is the main long-term risk. The Laravel 12 compatibility release came through automated Laravel Shift tooling, which is good for framework tracking but not proof of feature investment or security triage. Check the issue tracker, release cadence, and response history over the last 12 months, excluding automated pull requests. For long-lived production use, pin versions and keep a fallback plan.
- What are good alternatives to Metapi for Laravel API metadata and browsing?
- Alternatives depend on whether you need metadata management, API documentation, or generated endpoints. Laravel's native API Resources and resource collections are the baseline for shaping JSON, while documentation tools such as Scribe or Scramble focus on API docs and interactive browsing. If you mainly need metadata and benchmarking helpers, compare Metapi's feature set directly against those tools. Evaluate maintenance activity and authorization fit before choosing.