javaabu / meta
Meta fields for Eloquent models: define them once with javaabu/stencil, store them in typed, indexed columns, query them with whereMeta and orderByMeta, extend them with custom types, and translate them with javaabu/translatable.
Requires
- php: ^8.4
- illuminate/contracts: ^12.0 || ^13.0
- illuminate/database: ^12.0 || ^13.0
- illuminate/support: ^12.0 || ^13.0
- illuminate/validation: ^12.0 || ^13.0
- javaabu/stencil: ^1.0@dev
Requires (Dev)
- javaabu/boost-javaabu-guidelines: ^1.4
- javaabu/translatable: ^3.0@dev
- laravel/pint: ^1.24
- orchestra/testbench: ^10.0 || ^11.0
- phpunit/phpunit: ^11.5.3 || ^12.5.8
Suggests
- javaabu/translatable: Translate meta values per language (^3.0)
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-11-16 06:50:13 UTC
README
Meta fields for Eloquent models:
- Defining: define them once with javaabu/stencil fields.
- Storing: values are stored in typed, indexed columns.
- Querying:
whereMetaandorderByMetafilter and sort by them, and eager loading avoids N+1s. - Editing: edit them in a form rendered with Blade or Inertia React.
- Extending: add your own types.
- Translating: translate them with javaabu/translatable.
MetaFields::for(Post::class, [ TextInput::make('subtitle')->maxLength(255)->thaana()->translatable(), Checkbox::make('featured'), DatePicker::make('event_date'), ]);
class Post extends Model { use HasMeta; } $post->setMeta(['subtitle' => 'ރާއްޖޭގެ ޚަބަރު', 'featured' => true]); $post->getMeta('subtitle'); Post::whereMeta('featured', true)->whereMeta('event_date', '>=', today())->orderByMeta('event_date')->with('meta')->paginate(); MetaForm::for($post)->action(route('posts.meta.update', $post)); // {{ $form }} or <StencilForm schema={form} />
Documentation
You'll find the documentation on https://docs.javaabu.com/meta, and in the docs folder.
AI coding assistants can start from llms.txt. The package ships a Laravel Boost skill and guideline, which Boost finds by itself. See AI assistants.
Testing
composer test # SQLite DB_CONNECTION=mysql composer test # MySQL
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email info@javaabu.com instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.