Skip to content

Commit 758f755

Browse files
committed
Stan
1 parent 12ab1ce commit 758f755

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

packages/press/src/Models/WpCategory.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace Moox\Press\Models;
44

55
use Illuminate\Database\Eloquent\Builder;
6+
use Illuminate\Database\Eloquent\Relations\HasOne;
67
use Override;
78

89
class WpCategory extends WpTerm
@@ -20,4 +21,9 @@ protected static function boot()
2021
});
2122
});
2223
}
24+
25+
public function termTaxonomy(): HasOne
26+
{
27+
return $this->hasOne(WpTermTaxonomy::class, 'term_id', 'term_id');
28+
}
2329
}

packages/press/src/Models/WpTag.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace Moox\Press\Models;
44

55
use Illuminate\Database\Eloquent\Builder;
6+
use Illuminate\Database\Eloquent\Relations\HasOne;
67
use Override;
78

89
class WpTag extends WpTerm
@@ -20,4 +21,9 @@ protected static function boot(): void
2021
});
2122
});
2223
}
24+
25+
public function termTaxonomy(): HasOne
26+
{
27+
return $this->hasOne(WpTermTaxonomy::class, 'term_id', 'term_id');
28+
}
2329
}

0 commit comments

Comments
 (0)