laravel-meta icon indicating copy to clipboard operation
laravel-meta copied to clipboard

Simplifying querying meta

Open tmaly1980 opened this issue 7 years ago • 1 comments

Instead of:

$post = Post::meta()
    ->where(function($query){
          $query->where('posts_meta.key', '=', 'revision')
                ->where('posts_meta.value', '=', 'draft');
    })

It would be really helpful/nice to have something like this:

$post = Post::whereMeta(['revision'=>'draft'])

tmaly1980 avatar Jul 10 '17 15:07 tmaly1980

@tmaly1980 i'd be happy to merge the PR if you can on this.

kodeine avatar Jul 19 '17 05:07 kodeine