1. Go to this page and download the library: Download bambamboole/laravel-i18next 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/ */
bambamboole / laravel-i18next example snippets
return [
'routes' => [
'enabled' => true,
'prefix' => '', // e.g. 'api'
'middleware' => [], // e.g. ['web'] for session/CSRF
'locale_pattern' => '[A-Za-z_-]+', // also guards against path traversal
],
// Map a requested locale to the one used on disk, e.g. ['de-DE' => 'de'].
'locale_map' => [],
// The store route writes files to disk — keep it out of production.
'save_missing' => [
'enabled' => env('I18NEXT_SAVE_MISSING', true),
'middleware' => [], // e.g. ['auth'] or a throttle
],
// Cache the converted payload per locale; flushed when missing keys are saved.
'cache' => [
'enabled' => false,
'store' => null, // null = default cache store
'ttl' => null, // null = forever
],
// 'flat' = dotted keys (use keySeparator: false), 'nested' = nested JSON tree.
'output' => 'flat',
// Load translations as i18next namespaces (/locales/{lng}/{ns}.json).
'namespaces' => false,
];