kodeine / laravel-meta

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

getMetaTable and getMetaKeyName should be public #86

Closed goodevilgenius closed 3 years ago

goodevilgenius commented 3 years ago

Since the eloquent functions getTable and getKeyName are public, the corresponding meta functions should also be.

This will make it easier to make meta queries outside of the model. Currently, this is impossible outside of the class context:

$metaTable = (new Post)->getMetaTable();
Post::meta()->query(function ($query) use ($metaTable) {
    $query->where("$metaTable.name", 'key')->where("$metaTable.value", 'value');
});
kodeine commented 3 years ago

Can you submit PR?

goodevilgenius commented 3 years ago

@kodeine Sure. That's a pretty simple change. I can submit one later today.