When I try ti use global scope in my model:
protected static function boot()
{
parent::boot();
static::addGlobalScope(new PostScope(Post::TYPE_VIDEO));
static::addGlobalScope('video', function (Builder $builder) {
$builder->join('video_posts', 'post_id', '=', 'id');
});
}
It doesn't work, because somewhere Laravel process double-call function join()
.
Anybody encountered with it? How fix it?