{"id":13669405,"url":"https://github.com/rtconner/laravel-tagging","last_synced_at":"2025-05-13T19:14:26.906Z","repository":{"id":13013359,"uuid":"15692799","full_name":"rtconner/laravel-tagging","owner":"rtconner","description":"Tag support for Laravel Eloquent models - Taggable Trait","archived":false,"fork":false,"pushed_at":"2025-04-02T18:16:27.000Z","size":281,"stargazers_count":885,"open_issues_count":3,"forks_count":170,"subscribers_count":28,"default_branch":"master","last_synced_at":"2025-05-04T21:36:31.697Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rtconner.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2014-01-07T02:14:49.000Z","updated_at":"2025-04-27T12:20:03.000Z","dependencies_parsed_at":"2024-01-17T08:00:02.708Z","dependency_job_id":"f94e34bd-843a-4e3e-ba69-0b3afa7d04eb","html_url":"https://github.com/rtconner/laravel-tagging","commit_stats":{"total_commits":265,"total_committers":39,"mean_commits":6.794871794871795,"dds":0.2566037735849057,"last_synced_commit":"dcb06dfe25f40daf11f7e10d8106d8d56bc37743"},"previous_names":[],"tags_count":44,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rtconner%2Flaravel-tagging","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rtconner%2Flaravel-tagging/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rtconner%2Flaravel-tagging/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rtconner%2Flaravel-tagging/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rtconner","download_url":"https://codeload.github.com/rtconner/laravel-tagging/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253426197,"owners_count":21906501,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-02T08:01:12.535Z","updated_at":"2025-05-13T19:14:26.885Z","avatar_url":"https://github.com/rtconner.png","language":"PHP","funding_links":[],"categories":["PHP","Packages","数据库( Database )"],"sub_categories":["Helpers/General"],"readme":"Laravel Taggable Trait\n============\n\n[![Latest Stable Version](https://poser.pugx.org/rtconner/laravel-tagging/v/stable.svg)](https://packagist.org/packages/rtconner/laravel-tagging)\n[![Total Downloads](https://poser.pugx.org/rtconner/laravel-tagging/downloads.svg)](https://packagist.org/packages/rtconner/laravel-tagging)\n[![License](https://poser.pugx.org/rtconner/laravel-tagging/license.svg)](https://packagist.org/packages/rtconner/laravel-tagging)\n[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/rtconner/laravel-tagging/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/rtconner/laravel-tagging/?branch=master)\n\nThis package is not meant to handle javascript or html in any way. This package handles database storage and read/writes only.\n\nThere are no real limits on what characters can be used in a tag. It uses a slug transform to determine if two tags are identical (\"sugar-free\" and \"Sugar Free\" would be treated as the same tag). Tag display names are run through Str::title()\n\n```bash\ncomposer require rtconner/laravel-tagging\n```\n\n#### Install and then Run the migrations\n\nThe package should auto-discover when you composer update. Then publish the tagging.php and run the database migrations with these commands.\n\n```bash\nphp artisan vendor:publish --provider=\"Conner\\Tagging\\Providers\\TaggingServiceProvider\"\nphp artisan migrate\n```\n\n#### Setup your models\n```php\nclass Article extends \\Illuminate\\Database\\Eloquent\\Model\n{\n\tuse \\Conner\\Tagging\\Taggable;\n}\n```\n\n#### Quick Sample Usage\n\n```php\n$article = Article::with('tagged')-\u003efirst(); // eager load\n\nforeach($article-\u003etags as $tag) {\n\techo $tag-\u003ename . ' with url slug of ' . $tag-\u003eslug;\n}\n\n$article-\u003etag('Gardening'); // attach the tag\n\n$article-\u003euntag('Cooking'); // remove Cooking tag\n$article-\u003euntag(); // remove all tags\n\n$article-\u003eretag(array('Fruit', 'Fish')); // delete current tags and save new tags\n\n$article-\u003etagNames(); // get array of related tag names\n\nArticle::withAnyTag(['Gardening','Cooking'])-\u003eget(); // fetch articles with any tag listed\n\nArticle::withAllTags(['Gardening', 'Cooking'])-\u003eget(); // only fetch articles with all the tags\n\nArticle::withoutTags(['Gardening', 'Cooking'])-\u003eget(); // only fetch articles without all tags listed\n\nConner\\Tagging\\Model\\Tag::where('count', '\u003e', 2)-\u003eget(); // return all tags used more than twice\n\nArticle::existingTags(); // return collection of all existing tags on any articles\n```\n\n[Documentation: More Usage Examples](docs/usage-examples.md)\n\n[Documentation: Tag Groups](docs/tag-groups.md)\n\n[Documentation: Tagging Events](docs/events.md)\n\n[Documentation: Tag Suggesting](docs/suggesting.md)\n\n### Configure\n\n[See config/tagging.php](config/tagging.php) for configuration options.\n\n###### Lumen Installation\n\n[Documentation: Lumen](docs/lumen.md)\n\n#### Developer\n\n - Robert Conner - http://dealerzone.com\n - BlueSky - https://bsky.app/profile/robertconner.com\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frtconner%2Flaravel-tagging","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frtconner%2Flaravel-tagging","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frtconner%2Flaravel-tagging/lists"}