PHP code example of codiiv / laravel-taxonomies

1. Go to this page and download the library: Download codiiv/laravel-taxonomies 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/ */

    

codiiv / laravel-taxonomies example snippets


    composer dump-autoload
    

    php artisan vendor:publish --provider="Codiiv\Taxonomies\TaxonomiesServiceProvider"

    

    php artisan migrate

    
 $paginatedTerms  global 

         <ul class="the-items">
           @foreach($paginatedTerms as $key => $term )
           <li data-value="{{ $term->id }}" class="level-{{ $term->level }}">
                <a href="{{ url(Config::get('taxonomies.taxonomy_path')).'?taxonomy='.$taxonomy.'&term_id='.$term->id }}">
                    {{ $term->pointer.' '.$term->name }}
                </a>
           </li>
           @endforeach
         </ul>
         <div class="pagination-container">
           {{ $paginatedTerms->links() }}
         </div>

  $terms = $Taxonomy::sortedTerms($taxonomy, null, 0, []); 
 
    <select class="parent" name="parent">
       <option value=""> — — — — {{ __("Choose One") }} — — — — </option>
       @foreach($terms as $key => $term)
          <option value="{{ $term->id }}" class="level-{{ $term->level }}">{{ $term->pointer.' '.$term->name }}</option>
       @endforeach
    </select>
 php artisan vendor:publish --provider="Codiiv\Taxonomies\TaxonomiesServiceProvider" 
 config/taxonomies.php