Skip to content

Commit

Permalink
Fixed the tab with space
Browse files Browse the repository at this point in the history
  • Loading branch information
AnowarCST committed Apr 6, 2021
1 parent d8e7310 commit f7a0e59
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions app/Http/Controllers/API/V1/ProductController.php
Expand Up @@ -56,10 +56,10 @@ public function store(ProductRequest $request)
if ($existingtag) {
$tag_ids[] = $existingtag->id;
} else {
$newtag = Tag::create([
'name' => $tag['text']
]);
$tag_ids[] = $newtag->id;
$newtag = Tag::create([
'name' => $tag['text']
]);
$tag_ids[] = $newtag->id;
}
}
$product->tags()->sync($tag_ids);
Expand Down Expand Up @@ -99,12 +99,12 @@ public function update(ProductRequest $request, $id)
$existingtag = Tag::whereName($tag['text'])->first();
if ($existingtag) {
$tag_ids[] = $existingtag->id;
} else {
$newtag = Tag::create([
'name' => $tag['text']
]);
$tag_ids[] = $newtag->id;
}
} else {
$newtag = Tag::create([
'name' => $tag['text']
]);
$tag_ids[] = $newtag->id;
}
}
$product->tags()->sync($tag_ids);

Expand Down

0 comments on commit f7a0e59

Please sign in to comment.