Merge branch 'module_categories' into dev
This commit is contained in:
@@ -8,6 +8,7 @@ use Illuminate\Database\Eloquent\Model;
|
|||||||
use Illuminate\Support\Facades\App;
|
use Illuminate\Support\Facades\App;
|
||||||
use Illuminate\Support\Facades\DB;
|
use Illuminate\Support\Facades\DB;
|
||||||
use Mcamara\LaravelLocalization\Facades\LaravelLocalization;
|
use Mcamara\LaravelLocalization\Facades\LaravelLocalization;
|
||||||
|
use Modules\Categories\Entities\Category;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class Content
|
* Class Content
|
||||||
@@ -407,6 +408,11 @@ class Content extends Model
|
|||||||
return $this->belongsToMany(File::class, 'contents_has_files');
|
return $this->belongsToMany(File::class, 'contents_has_files');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function category()
|
||||||
|
{
|
||||||
|
return $this->belongsTo(Category::class);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Save history entry into database
|
* Save history entry into database
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
namespace Modules\Categories\Entities;
|
namespace Modules\Categories\Entities;
|
||||||
|
|
||||||
|
use App\Models\Content;
|
||||||
use App\Models\Module;
|
use App\Models\Module;
|
||||||
use Franzose\ClosureTable\Models\Entity;
|
use Franzose\ClosureTable\Models\Entity;
|
||||||
|
|
||||||
@@ -12,9 +13,7 @@ class Category extends Entity implements CategoryInterface
|
|||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
protected $table = 'categories';
|
protected $table = 'categories';
|
||||||
|
|
||||||
public $timestamps = true;
|
public $timestamps = true;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ClosureTable model instance.
|
* ClosureTable model instance.
|
||||||
*
|
*
|
||||||
@@ -22,7 +21,13 @@ class Category extends Entity implements CategoryInterface
|
|||||||
*/
|
*/
|
||||||
protected $closure = 'Modules\Categories\Entities\CategoryClosure';
|
protected $closure = 'Modules\Categories\Entities\CategoryClosure';
|
||||||
|
|
||||||
public function module() {
|
public function module()
|
||||||
|
{
|
||||||
return $this->belongsTo(Module::class);
|
return $this->belongsTo(Module::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function content()
|
||||||
|
{
|
||||||
|
return $this->hasMany(Content::class);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user