FEATURE: add relationship methods to categories and content

This commit is contained in:
Michal Kváček
2016-08-13 19:02:58 +02:00
parent 54e5927bb1
commit befb95a4ac
2 changed files with 14 additions and 3 deletions
+6
View File
@@ -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
*