PHP code example of brunoscode / twill-translation-handler
1. Go to this page and download the library: Download brunoscode/twill-translation-handler 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/ */
brunoscode / twill-translation-handler example snippets
'legacy-twill-navigation' => false,
use A17\Twill\Facades\TwillNavigation;
use A17\Twill\View\Components\Navigation\NavigationLink;
TwillNavigation::addLink(
NavigationLink::make()->title('Translations')
->forModule('translations')
->doNotAddSelfAsFirstChild()
->setChildren([
NavigationLink::make()->title('Translations')->forModule('translations'),
NavigationLink::make()->title('Groups')->forModule('translationGroups'),
NavigationLink::make()->title('Import / Export')->forRoute('twill.translations.translationTools.index'),
])
);
bash
php artisan migrate
# Add new keys and locales from PHP files to the DB, without overwriting existing DB values
php artisan translation-handler php db
# Overwrite PHP files with the authoritative DB values
php artisan translation-handler db php --force
bash
> php artisan translation-handler php db --force
>