PHP code example of denismitr / tagging

1. Go to this page and download the library: Download denismitr/tagging library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

denismitr / tagging example snippets


Denismitr\Tagging\TaggingServiceProvider::class

use Taggable;

/**
 * Get tags relationship
 *
 * @return MorphToMany
 */
public function tags()

/**
 * Tag with one or more tags
 *
 * @param  array|string|Tag $tags
 * @return void
 */
public function tag($tags)

/**
 * Remove tag or tags
 *
 * @param  array|string|Tag $tags
 * @return void
 */
public function untag($tags = null)

/**
 * Remove all tags and then add tag or tags
 *
 * @param  array|string|Tag $tags
 * @return void
 */
public function retag($tags)

public function scopeWithAnyTag($query, array $tags)

public function scopeWithAllTag($query, array $tags)

public function scopeHasTags($query, array $tags)

public function scopeUsedGte($query, $count)

public function scopeUsedGt($query, $count)

public function scopeUsedLte($query, $count)

public function scopeUsedLt($query, $count)