You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/Traits/HasTaxonomy.php
+307Lines changed: 307 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -132,6 +132,137 @@ public function toggleTaxonomies($taxonomies, string $name = 'taxonomable'): sel
132
132
return$this;
133
133
}
134
134
135
+
/**
136
+
* Detach taxonomies of a specific type from the model.
137
+
*
138
+
* @param string|\Aliziodev\LaravelTaxonomy\Enums\TaxonomyType $type The taxonomy type
139
+
* @param int|string|array<int, int|string|\Aliziodev\LaravelTaxonomy\Models\Taxonomy>|\Aliziodev\LaravelTaxonomy\Models\Taxonomy|\Illuminate\Database\Eloquent\Collection<int, \Aliziodev\LaravelTaxonomy\Models\Taxonomy>|null $taxonomies The taxonomies to detach (null to detach all of this type)
140
+
* @param string $name The name of the relationship (default: 'taxonomable')
* Sync taxonomies of a specific type with the model.
175
+
*
176
+
* @param string|\Aliziodev\LaravelTaxonomy\Enums\TaxonomyType $type The taxonomy type
177
+
* @param int|string|array<int, int|string|\Aliziodev\LaravelTaxonomy\Models\Taxonomy>|\Aliziodev\LaravelTaxonomy\Models\Taxonomy|\Illuminate\Database\Eloquent\Collection<int, \Aliziodev\LaravelTaxonomy\Models\Taxonomy> $taxonomies The taxonomies to sync
178
+
* @param string $name The name of the relationship (default: 'taxonomable')
* Attach taxonomies of a specific type to the model.
212
+
*
213
+
* @param string|\Aliziodev\LaravelTaxonomy\Enums\TaxonomyType $type The taxonomy type
214
+
* @param int|string|array<int, int|string|\Aliziodev\LaravelTaxonomy\Models\Taxonomy>|\Aliziodev\LaravelTaxonomy\Models\Taxonomy|\Illuminate\Database\Eloquent\Collection<int, \Aliziodev\LaravelTaxonomy\Models\Taxonomy> $taxonomies The taxonomies to attach
215
+
* @param string $name The name of the relationship (default: 'taxonomable')
* Toggle taxonomies of a specific type for the model.
240
+
*
241
+
* @param string|\Aliziodev\LaravelTaxonomy\Enums\TaxonomyType $type The taxonomy type
242
+
* @param int|string|array<int, int|string|\Aliziodev\LaravelTaxonomy\Models\Taxonomy>|\Aliziodev\LaravelTaxonomy\Models\Taxonomy|\Illuminate\Database\Eloquent\Collection<int, \Aliziodev\LaravelTaxonomy\Models\Taxonomy> $taxonomies The taxonomies to toggle
243
+
* @param string $name The name of the relationship (default: 'taxonomable')
* Determine if the model has any of the given taxonomies of a specific type.
305
+
*
306
+
* @param string|\Aliziodev\LaravelTaxonomy\Enums\TaxonomyType $type The taxonomy type
307
+
* @param int|string|array<int, int|string|\Aliziodev\LaravelTaxonomy\Models\Taxonomy>|\Aliziodev\LaravelTaxonomy\Models\Taxonomy|\Illuminate\Database\Eloquent\Collection<int, \Aliziodev\LaravelTaxonomy\Models\Taxonomy> $taxonomies The taxonomies to check
308
+
* @param string $name The name of the relationship (default: 'taxonomable')
309
+
* @return bool True if the model has any of the given taxonomies of the specified type
* Determine if the model has all of the given taxonomies of a specific type.
324
+
*
325
+
* @param string|\Aliziodev\LaravelTaxonomy\Enums\TaxonomyType $type The taxonomy type
326
+
* @param int|string|array<int, int|string|\Aliziodev\LaravelTaxonomy\Models\Taxonomy>|\Aliziodev\LaravelTaxonomy\Models\Taxonomy|\Illuminate\Database\Eloquent\Collection<int, \Aliziodev\LaravelTaxonomy\Models\Taxonomy> $taxonomies The taxonomies to check
327
+
* @param string $name The name of the relationship (default: 'taxonomable')
328
+
* @return bool True if the model has all of the given taxonomies of the specified type
* @param string|\Aliziodev\LaravelTaxonomy\Enums\TaxonomyType $type The taxonomy type
446
+
* @param int|string|array<int, int|string|\Aliziodev\LaravelTaxonomy\Models\Taxonomy>|\Aliziodev\LaravelTaxonomy\Models\Taxonomy|\Illuminate\Database\Eloquent\Collection<int, \Aliziodev\LaravelTaxonomy\Models\Taxonomy> $taxonomies The taxonomies to filter by
447
+
* @param string $name The name of the relationship (default: 'taxonomable')
* @param string|\Aliziodev\LaravelTaxonomy\Enums\TaxonomyType $type The taxonomy type
466
+
* @param int|string|array<int, int|string|\Aliziodev\LaravelTaxonomy\Models\Taxonomy>|\Aliziodev\LaravelTaxonomy\Models\Taxonomy|\Illuminate\Database\Eloquent\Collection<int, \Aliziodev\LaravelTaxonomy\Models\Taxonomy> $taxonomies The taxonomies to filter by
467
+
* @param string $name The name of the relationship (default: 'taxonomable')
* @param string|\Aliziodev\LaravelTaxonomy\Enums\TaxonomyType $type The taxonomy type
498
+
* @param int|string|array<int, int|string|\Aliziodev\LaravelTaxonomy\Models\Taxonomy>|\Aliziodev\LaravelTaxonomy\Models\Taxonomy|\Illuminate\Database\Eloquent\Collection<int, \Aliziodev\LaravelTaxonomy\Models\Taxonomy> $taxonomies The taxonomies to exclude
499
+
* @param string $name The name of the relationship (default: 'taxonomable')
0 commit comments