-
Notifications
You must be signed in to change notification settings - Fork 397
Open
Description
Sometimes I see this pop up while typing.

I'm not sure how it happens. but what do you think of updateOrCreate Method
<?php
$allTags = WinkTag::all();
return collect($incomingTags)->map(function ($incomingTag) use ($allTags) {
$tag = $allTags->where('id', $incomingTag['id'])->first();
if (! $tag) {
$tag = WinkTag::create([
'id' => $id = Str::uuid(),
'name' => $incomingTag['name'],
'slug' => Str::slug($incomingTag['name']),
]);
}
return (string) $tag->id;
})->toArray();cjmellor, lukesnowden, aymericauberger, rachids and yevhen113
Metadata
Metadata
Assignees
Labels
No labels