Popular Tags.
1dump(Tag::popular()->get());2// Returns Illuminate\Database\Eloquent\Collection
Getting all tags of the model.
1dump($article->tags);2// Returns Illuminate\Database\Eloquent\Collection
You can publish your config, migrations and you can find the config here : config/Pharaonic/taggable.php.
1php artisan vendor:publish --tag=laravel-taggable
1return [2 'children' => [3 'articles' => App\Models\Article::class, 4 ]5];
Then you can get the tag children like articles or products, etc...
1dump($tag->articles);2// Returns Illuminate\Database\Eloquent\Collection