Search by

javaabu / meta

dash8xjavaabun4ff4h

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.

Package info

github.com/Javaabu/meta

pkg:composer/javaabu/meta

Statistics

Installs: 0

Dependents: 1

Suggesters: 0

Stars: 0

Open Issues: 2

dev-main / 1.x-dev 2026-11-16 06:50 UTC

This package is auto-updated.

Last update: 2026-11-16 06:50:13 UTC


README

Tests codecov Latest Version on Packagist License: MIT

Meta fields for Eloquent models:

  • Defining: define them once with javaabu/stencil fields.
  • Storing: values are stored in typed, indexed columns.
  • Querying: whereMeta and orderByMeta filter 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.