FEATURE: add relationship methods to categories and content
This commit is contained in:
@@ -8,6 +8,7 @@ use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Support\Facades\App;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Mcamara\LaravelLocalization\Facades\LaravelLocalization;
|
||||
use Modules\Categories\Entities\Category;
|
||||
|
||||
/**
|
||||
* Class Content
|
||||
@@ -407,6 +408,11 @@ class Content extends Model
|
||||
return $this->belongsToMany(File::class, 'contents_has_files');
|
||||
}
|
||||
|
||||
public function category()
|
||||
{
|
||||
return $this->belongsTo(Category::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Save history entry into database
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user