PHP code example of slash-dw / tagging-kit

1. Go to this page and download the library: Download slash-dw/tagging-kit 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/ */

    

slash-dw / tagging-kit example snippets

bash
php artisan vendor:publish --tag="tagging-kit-config"
tsx
import { configureTaggingUi, useTaggingBootstrap } from '@slash-dw/tagging-ui';

// Optional host overrides (win over backend /tagging/config defaults).
configureTaggingUi({
  baseUrl: '/api',                  // → {base}/tagging/{suggest,config,tags/:id}
  fetch: myCsrfAwareFetch,          // optional auth-aware fetch wrapper
  i18n: { placeholder: 'Etiket ekle…' },
  hooks: { onUserTagDeleted: (t) => analytics.track('tag_deleted', t) },
});

function TaggingBootstrap() {
  useTaggingBootstrap();            // GET /api/tagging/config → internal store
  return null;
}
tsx
import { TagAutocomplete, type Tag } from '@slash-dw/tagging-ui';

function Form() {
  const [tags, setTags] = useState<Tag[]>([]);
  return <TagAutocomplete tagType={100} value={tags} onChange={setTags} />;
}