kodeine / laravel-meta

Fluent Meta Data for Eloquent Models, as if it is a property on your model
MIT License
398 stars 89 forks source link

Can I have a schema ? #98

Closed vahidalvandi closed 2 years ago

vahidalvandi commented 2 years ago

hi i have table and i want add same meta in meta table , but i need to user can create manully Her desired meta data . like form builder and in view data can see each meta with label and data saved to db

siamak2 commented 2 years ago

Hi You can get all metas using getMeta() method without any parameter. it's return value is a Collection of all metas where the key is name of the meta. so your view can look something like this:

@foreach($model->getMeta() as $key => $value)
    <label for="{{$key}}">{{$key}}</label>
    <input id="{{$key}}" value="{{$value}}">
@endforeach
vahidalvandi commented 2 years ago

Thank you . How I can manage them with simple ui . Or do you now standard starter for build meta and forms?

siamak2 commented 2 years ago

I don't know if any starter pack exists. You need to create the ui yourself. just loop all metas like the example and add buttons for add new meta and delete this meta.