packages/press-wiki/src/Models/WpWikiCompanyTopic.php
<?php
namespace Moox\PressWiki\Models;
use Illuminate\Database\Eloquent\Builder;
use Moox\Press\Models\WpTerm;
class WpWikiCompanyTopic extends WpTerm
{
public static function boot()
{
parent::boot();
static::addGlobalScope('company', function (Builder $builder) {
$builder->whereHas('termTaxonomy', function ($query) {
$query->where('taxonomy', 'wiki_firmen');
});
});
}
}