Topic Fix in commands
This commit is contained in:
@@ -63,10 +63,7 @@ class ScrapeThiladhunCommand extends Command
|
||||
]);
|
||||
|
||||
collect($article["topics"])->each(function ($topic) use ($articleModel) {
|
||||
$topicModel = Topic::firstOrCreate([
|
||||
"name" => $topic["name"],
|
||||
"slug" => $topic["slug"],
|
||||
]);
|
||||
$topicModel = Topic::firstOrCreate(["slug" => $topic["slug"]],["name" => $topic["name"]]);
|
||||
|
||||
$topicModel->articles()->syncWithoutDetaching($articleModel);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user