[WIP] Add thumb on offers, refactor categories, try to fix counter on relations polymorphic with eage loader, bad pattern !
This commit is contained in:
16
app/Models/Core/Category.php
Normal file
16
app/Models/Core/Category.php
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Core;
|
||||
|
||||
use Rinvex\Categories\Models\Category as parentCategory;
|
||||
|
||||
use App\Models\Shop\Article;
|
||||
|
||||
class Category extends parentCategory
|
||||
{
|
||||
public function Articles()
|
||||
{
|
||||
// return $this->entries(Article::class);
|
||||
return $this->morphedByMany(Article::class, 'categorizable');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user