Skip to content

Commit

Permalink
Merge pull request #18 from sl0wik/bugfix/component_and_menu_fix
Browse files Browse the repository at this point in the history
Bugfix: component and menu fix
  • Loading branch information
sl0wik authored Mar 24, 2018
2 parents 1e2c235 + 75417e5 commit b506776
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/Models/Content.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ public function getComponents($name = null)

return $query->get()->map(function ($componentPayload) {
$output = $componentPayload->payload;
$output->component_name = $componentPayload->component->name;

if ($componentPayload->component->custom('gallery')) {
$images = Image::where([['parent_type', 'component-payloads'], ['parent_id', $componentPayload->id]])->get();
Expand Down
1 change: 1 addition & 0 deletions src/Models/Menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public static function generate($name)
$fields = ['url_path', 'id', 'parent_id', 'head_title', 'menu_title', 'website_id', 'status'];

$content = self::where('name', $name)
->where('website_id', env('WEBSITE_ID'))
->with('contents')
->first()
->contents()
Expand Down

0 comments on commit b506776

Please sign in to comment.