Skip to main content

Black Friday 2025! Only until December 1st: coupon FRIDAY25 for 40% off Yearly/Lifetime membership!

Read more here

Kovah/LinkAce

3159 stars
1 code files
View Kovah/LinkAce on GitHub

app/Repositories/LinkRepository.php

Open in GitHub
class LinkRepository
{
//
protected static function processTaxonomy(string $model, array $entries): Collection
{
$newEntries = collect();
 
foreach ($entries as $entry) {
if (is_int($entry)) {
$newEntry = Tag::find($entry);
} else {
$newEntry = $model::firstOrCreate([
'user_id' => auth()->id(),
'name' => trim($entry),
]);
}
 
if ($newEntry !== null) {
$newEntries->push($newEntry->id);
}
}
 
return $newEntries;
}
}

We'd Love Your Feedback

Tell us what you like or what we can improve

Feel free to share anything you like or dislike about this page or the platform in general.