A custom Laravel Nova field to transforming text to Hiragana or Katakana.
Install the package via Composer:
composer require bocanhcam/nova-japanese-transformer
Add the field to your Nova resource:
use Bocanhcam\NovaJapaneseTransformer\JapaneseTransformerText;
use Bocanhcam\NovaJapaneseTransformer\JapaneseTransformerTextarea;
// Text
JapaneseTransformerText::make('Name'), // Convert Romaji to Kana. outputs Hiragana by default; uppercase text outputs Katakana.
JapaneseTransformerText::make('Hiragana')->toHiragana(), // Convert Katakana or Romaji to Hiragana.
JapaneseTransformerText::make('Katakana')->toKatakana(), // Convert Hiragana or Romaji to Katakana.
// Textarea
JapaneseTransformerTextarea::make('Description'), // Have the same function like Text field
For more details on wanakana, check out their documentation.
This package is open-sourced software licensed under the MIT license.