1. Go to this page and download the library: Download trexology/taxonomy 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/ */
$car = Car::create([
'model' => 'A3',
]);
$car->addTerm($term_bmw->id);
$car->addTerm($term_benz->id);
$car->removeAllTerms(); // Remove all terms linked to this car
$car->addTerm($term_ferrari->id);
$car->removeTerm($term_ferrari-id); // Remove a specific term
$car->addTerm($term_audi->id);
// Get all the terms from the vocabulary 'Cars' That
// are attached to this Car.
$terms = $car->getTermsByVocabularyName('Cars');