Downloads
Stars
Version
composer require dorkyboi/laravel-frontend-translations
translator.js
file to your public folder by running php artisan vendor:publish --tag=translator
@frontendTranslations
blade directive to your master blade. This will add code that will load cached copy of laravel's translation files:
<script>
window.translations = {!! Cache::get('translations') !!};
</script>
<script src="/js/translator.js"></script>
Use translation function in the same way as you use __()
function,
e.g. translate('auth.failed')