FEATURE: add another repositories
This commit is contained in:
@@ -14,7 +14,7 @@ class Content extends Repository implements IContent
|
||||
/**
|
||||
* @var ContentModel
|
||||
*/
|
||||
private $model;
|
||||
protected $model;
|
||||
|
||||
public function __construct(ContentModel $model)
|
||||
{
|
||||
@@ -54,9 +54,16 @@ class Content extends Repository implements IContent
|
||||
$page = new ContentModel();
|
||||
$page->user_id = \Auth::user()->id;
|
||||
$page->language = LaravelLocalization::getCurrentLocale();
|
||||
$page->status = IContent::STATUS_DRAFT;
|
||||
$page->module_settings = [];
|
||||
} else {
|
||||
$page = $this->model->find($id);
|
||||
if (is_numeric($id)) {
|
||||
$page = $this->model->findOrFail($id);
|
||||
} else {
|
||||
$page = $this->model->where('language', LaravelLocalization::getCurrentLocale())
|
||||
->where('url', $id)
|
||||
->firstOrFail();
|
||||
}
|
||||
$page->module_settings = json_decode($page->module_settings);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user