PHP code example of webpress / tag-manager

1. Go to this page and download the library: Download webpress/tag-manager 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/ */

    

webpress / tag-manager example snippets


'models'          => [
    'tag' => App\Entities\Tag::class,
],

'transformers'    => [
    'tag' => App\Transformers\TagTransformer::class,
],

'auth_middleware' => [
        'admin'    => [
            'middleware' => 'jwt.auth',
            'except'     => ['index'],
        ],
        'frontend' => [
            'middleware' => 'jwt.auth',
            'except'     => ['index'],
        ],
],

public function scopeIsPublished($query)

public function scopeSortByName($query, $order = 'asc')

public function scopeMostUsed($query, $tagable_type = null) 

public function scopeLeastUsed($query, $taggable_type = null)

namespace App\Model;

use VCComponent\Laravel\Tag\Traits\TagQueryTrait;

class Tag 
{
    use TagQueryTrait;
    \\
}

namespace App\Model;

use VCComponent\Laravel\Tag\Entities\Tag as BaseTag;

class Tag extends BaseTag
{
    \\
}

$category = Tag::isPublished()->mostUsed()->get();