Download the PHP package suppercup/laravel-tags without Composer

On this page you can find all versions of the php package suppercup/laravel-tags. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-tags

Rinvex Tags

Rinvex Tags is a polymorphic Laravel package, for tag management. You can tag any eloquent model with ease, and utilize the awesomeness of Sluggable, and Translatable models out of the box.

Packagist Scrutinizer Code Quality Travis StyleCI License

Installation

  1. Install the package via composer:

  2. Publish resources (migrations and config files):

  3. Execute migrations via the following command:

  4. Done!

Usage

To add tags support to your eloquent models simply use \Rinvex\Tags\Traits\Taggable trait.

Manage your tags

Your tags are just normal eloquent models, so you can deal with it like so. There's few more methods added to tag models for your convenience, let's take a look:

Notes:

  • Rinvex Tags extends and utilizes other awesome packages, to be translatable out of the box using spatie/laravel-translatable, and for automatic Slugging it uses spatie/laravel-sluggable packages. Them them out.
  • Both findByName() and findByNameOrCreate() methods accepts either one or more tags as their first argument, and always return a collection.

Manage your taggable model

The API is intutive and very straightfarwad, so let's give it a quick look:

You can attach tags in various ways:

Notes:

  • The attachTags() method attach the given tags to the model without touching the currently attached tags, while there's the syncTags() method that can detach any records that's not in the given items, this method takes a second optional boolean parameter that's set detaching flag to true or false.
  • To detach model tags you can use the detachTags() method, which uses exactly the same signature as the attachTags() method, with additional feature of detaching all currently attached tags by passing null or nothing to that method as follows: $post->detachTags();.
  • You may have multiple tags with the same name and the same locale, in such case the first record found is used by default. This is intended by design to ensure a consistent behavior across all functionality whether you are attaching, detaching, or scoping model tags.

And as you may have expected, you can check if tags attached:

Notes:

  • The hasAnyTags() method check if ANY of the given tags are attached to the model. It returns boolean true or false as a result.
  • Similarly the hasAllTags() method uses exactly the same signature as the hasAnyTags() method, but it behaves differently and performs a strict comparison to check if ALL of the given tags are attached.

Advanced usage

Generate tag slugs

Rinvex Tags auto generates slugs and auto detect and insert default translation for you if not provided, but you still can pass it explicitly through normal eloquent create method, as follows:

Note: Check Sluggable package for further details.

Smart parameter detection

Rinvex Tags methods that accept list of tags are smart enough to handle almost all kinds of inputs as you've seen in the above examples. It will check input type and behave accordingly.

Retrieve all models attached to the tag

You may encounter a situation where you need to get all models attached to certain tag, you do so with ease as follows:

Query scopes

Yes, Rinvex Tags shipped with few awesome query scopes for your convenience, usage example:

Notes:

  • The withAnyTags() scope finds posts with ANY attached tags of the given. It returns normally a query builder, so you can chain it or call get() method for example to execute and get results.
  • Similarly there's few other scopes like withAllTags() that finds posts with ALL attached tags of the given, withoutTags() which finds posts without ANY attached tags of the given, and lastly withoutAnyTags() which find posts without ANY attached tags at all. All scopes are created equal, with same signature, and returns query builder.

Tag translations

Manage tag translations with ease as follows:

Note: Check Translatable package for further details.

Changelog

Refer to the Changelog for a full history of the project.

Support

The following support channels are available at your fingertips:

Contributing & Protocols

Thank you for considering contributing to this project! The contribution guide can be found in CONTRIBUTING.md.

Bug reports, feature requests, and pull requests are very welcome.

Security Vulnerabilities

If you discover a security vulnerability within this project, please send an e-mail to [email protected]. All security vulnerabilities will be promptly addressed.

About Rinvex

Rinvex is a software solutions startup, specialized in integrated enterprise solutions for SMEs established in Alexandria, Egypt since June 2016. We believe that our drive The Value, The Reach, and The Impact is what differentiates us and unleash the endless possibilities of our philosophy through the power of software. We like to call it Innovation At The Speed Of Life. That’s how we do our share of advancing humanity.

License

This software is released under The MIT License (MIT).

(c) 2016-2020 Rinvex LLC, Some rights reserved.


All versions of laravel-tags with dependencies

PHP Build Version
Package Version
Requires php Version ^7.4.0|^7.3
illuminate/console Version ^7.0.0
illuminate/database Version ^7.0.0
illuminate/support Version ^7.0.0
suppercup/laravel-cacheable Version ^1.0.0
suppercup/laravel-support Version ^1.0.0
spatie/eloquent-sortable Version ^3.7.0
spatie/laravel-sluggable Version ^2.2.0
spatie/laravel-translatable Version ^4.2.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package suppercup/laravel-tags contains the following files

Loading the files please wait ....