Having the power of expressing strong emotions orįorcible arguments in an elevated, impassioned, and effective manner Īdapted to express strong emotion or to state factsĪrguments with fluency and power as, an eloquent address or statement Įloquent El"o*quent, a. See CONTRIBUTING.md for how to contribute changes.Expressing yourself readily, clearly, effectively "able to dazzle with his facile tongue" "silver speech" Michael Riediger for helping optimize the SQL. Who has contributed to this project, with a big shout-out to Bugs, Suggestions, Contributions and Support Model, service, and migration classes will all read the configuration values. If you want to use different table names, then change these two values. tablesīy default, the package will create two tables to store the tag information. Your own class, and update the configuration to reference your model. Use your own customized Tag model, then extend the package's class with modelīy default, the package will use its own model class for Tags. This will return a collection of all the Posts that are tagged "Apple". $posts = Tag:: findByName( 'Apple')-> posts posts) and the values are the qualifiedĬlass names of the models that are taggable (e.g. If you want to be able to find all the models that share a tag, you will need You can then catch the exception in your application code and handle it however you like. Throw a Cviebrock\EloquentTaggable\Exceptions\NoTagsSpecifiedException exception in these cases. However, if throwEmptyExceptions is set to true, then passing an empty value to the scope will So you don't need to check for empty values before calling the scope. This makes your application code cleaner, Will "short-circuit" the query and return no models. if the list is empty!īy default, the throwEmptyExceptions is set to false. Logically, you can't get a list of models that have all or any of a list of tags. Passing empty strings or arrays to any of the scope methods is an interesting situation. Otherwise, it will use the default connection (i.e. You can set this to specify that the Tag model should use a different database connection. ConfigurationĬonfiguration is handled through the settings in /app/config/taggable.php. Find all the tags that aren't used by any model: $tagService-> getAllUnusedTags() Īs always, take a look at the code for full documentation of the service class. $tagService-> getPopularTags( $limit, \ App\ Model, $minimumCount) $tagService-> getPopularTags( $limit, \ App\ Model) Get the most popular tags across all models, or for just one model: $tagService-> getPopularTags() Rename all tags from "Apple" to "Apricot" across all models: $tagService-> renameTags(" Apple", " Apricot") Rename all tags from "Apple" to "Apricot" for the \App\Model uses // (same as doing \App\Model::renameTag("Apple", "Apricot") ): $tagService-> renameTags(" Apple", " Apricot", \ App\ Model) Return a collection of all the Tag models used by all models: $tagService-> getAllTags() Return a collection of all the Tag models used by \App\Model instances // (same as doing \App\Model::allTagModels() ): $tagService-> getAllTags(\ App\ Model) Instantiate the service (can also be done via dependency injection) $tagService = app(\ Cviebrock\ EloquentTaggable\ Services\ TagService::class) Install the cviebrock/eloquent-taggable package via composer: The master branch by default, which might not be what you want). The correct README.md for your version (GitHub displays the version in UPGRADING.md for specifics, and be sure that you are reading Older versions of Laravel can use older versions of the package, although theyĪre no longer supported or maintained. † Version 3.1 of the package requires PHP 7.0 or later, even though Laravel 5.4 doesn't. Version should match the Laravel version.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |