- What is appstract/laravel-meta used for?
- It adds SEO-friendly metadata to Eloquent models using a polymorphic key-value table and a model trait. You can define titles, descriptions, Open Graph tags, and Twitter tags in PHP and render them in Blade views. It fits cases where you need arbitrary, schema-less attributes across many model types. It is a poor fit when you need to filter, sort, aggregate, or join on metadata at scale.
- How do I install appstract/laravel-meta in a Laravel app?
- The normal path is composer require appstract/laravel-meta, publish the migration and config, run migrations, and add the package trait to target models. The integration surface is shallow. However, the last release is from January 2018, so verify installation on your exact Laravel and PHP matrix. Assume a constraint-widened fork may be required before you commit.
- Does appstract/laravel-meta support Laravel 10 or Laravel 11?
- Not out of the box. The last release predates Laravel 6, so its illuminate and PHP version pins will likely block composer require on Laravel 9, 10, and 11. You will probably need to fork the package, widen constraints, and run a regression suite against your target framework version. Validate this in a throwaway branch before planning adoption.
- How do I add meta tags to an Eloquent model with appstract/laravel-meta?
- Add the package trait to the model, then use its get and set helpers to store metadata keys and values. Keep reads and writes behind an application service such as MetaService so the package remains an implementation detail. This boundary makes future migration or replacement much cheaper.
- How do I render appstract/laravel-meta tags in Blade views?
- Read the metadata through your service or model helpers and output title, description, Open Graph, and Twitter tags in a Blade layout partial. Escape all values to avoid broken markup or injection issues. Centralizing rendering in one component keeps SEO tag output consistent across pages.
- Is appstract/laravel-meta still maintained?
- No. The last release was in January 2018, and there is effectively no upstream maintenance. If you adopt it, you inherit bug fixes, security patching, and compatibility work. Assign a named owner and patch cadence before using it in production.
- What are alternatives to appstract/laravel-meta for SEO metadata in Laravel?
- On modern Laravel, native JSON columns such as Postgres jsonb or MySQL JSON are often sufficient and more queryable. A dedicated metadata table or an actively maintained SEO package may also be better. If you need filtering, sorting, or reporting on metadata, prefer JSON columns or explicit schema over a generic key-value store.
- Why does appstract/laravel-meta cause N+1 queries and how can I avoid them?
- Metadata is loaded per model through the polymorphic relation, so list views can trigger one query per row unless you eager load the relation. Add composite indexes on model_type and model_id, eager load metadata where needed, and cache rendered values for hot pages. If you need metadata in filters or list columns, the key-value pattern is likely the wrong tool.
- Can I filter or sort Eloquent models by meta values with appstract/laravel-meta?
- Not efficiently. A polymorphic key-value store turns filtering, sorting, aggregation, and joins into scans or awkward self-joins, especially as data grows. It works for arbitrary attributes you only load after fetching models, not for search facets or reporting. Use native JSON columns or an explicit table when metadata must be queryable.
- How should I test and production-harden a fork of appstract/laravel-meta?
- Fork the package, widen PHP and illuminate constraints, and add a regression test suite that passes on your exact Laravel matrix. Add composite indexes on model_type and model_id, plan cleanup for orphaned rows after model deletes, and wrap all access in a MetaService boundary. Pin the fork version in composer.json and document how it diverges from upstream.