Skip to content

Commit a4225ec

Browse files
Fixed: seed issue
1 parent d86fc36 commit a4225ec

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

Libraries/CmsSeeder.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
use Illuminate\Support\Facades\DB;
44
use Illuminate\Support\Str;
5+
use VaahCms\Modules\Cms\Models\ContentType;
56
use VaahCms\Modules\Cms\Models\ContentTypeBase;
67
use VaahCms\Modules\Cms\Models\Content;
78
use WebReinvent\VaahCms\Models\ThemeTemplate;
@@ -235,8 +236,7 @@ public static function contentTypes($file_path)
235236
->where('slug', $content_type['content']['slug'])
236237
->first();
237238

238-
$stored = ContentTypeBase::find($stored->id);
239-
239+
$stored = ContentType::find($stored->id);
240240

241241
//template groups
242242
ContentTypeBase::syncWithFormGroups($stored, $content_type['groups']);

Models/ContentTypeBase.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,9 +339,10 @@ public static function getItemWithRelations($id)
339339

340340
}
341341
//-------------------------------------------------
342-
public static function syncWithFormGroups(ContentTypeBase $content_type, $groups_array)
342+
public static function syncWithFormGroups(ContentType $content_type, $groups_array)
343343
{
344344

345+
345346
$stored_groups = $content_type->groups()->get()->pluck('slug','id')->toArray();
346347

347348
$input_groups = collect($groups_array)->pluck('slug')->toArray();

0 commit comments

Comments
 (0)