FEATURE: merge template namespace and module alias

This commit is contained in:
Michal Kváček
2017-02-10 13:45:41 +01:00
parent 9451357e02
commit 35bda2828c
7 changed files with 16 additions and 26 deletions
+3 -2
View File
@@ -11,6 +11,7 @@ use App\Models\ActionLog\ActionLogType;
use App\Models\Content\Content;
use App\Models\Module;
use App\Models\User;
use Illuminate\Support\Collection;
use Modules\Blog\Article\Entities\Comment;
class Article extends Handler implements ContentTitles, AdvancedContentModifier, InstallableModule
@@ -25,8 +26,8 @@ class Article extends Handler implements ContentTitles, AdvancedContentModifier,
*/
public function render(Content $content, $parameters)
{
$content->comments = [];
if (isset($content->moduleSettings->allowComments) && $content->moduleSettings->allowComments) {
$content->comments = new Collection();
if (isset($content->moduleSettings['allowComments']) && $content->moduleSettings['allowComments']) {
$content->comments = Comment::where('content_id', $content->id)
->with('author')
->where('approved', 1)