mooxphp/moox

View on GitHub
packages/press-wiki/src/Models/WpWikiCompanyTopic.php

Summary

Maintainability
A
0 mins
Test Coverage
<?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');
            });
        });
    }
}