|
41 | 41 | '404_view' => 'errors.404', |
42 | 42 |
|
43 | 43 | /** |
44 | | - * The custom route action where we will set the locale of |
45 | | - * the routes registered within the Route::localized() closure. |
| 44 | + * The custom route action where we will set the locale of the routes |
| 45 | + * that are registered within the Route::localized() closure. |
| 46 | + * This can be detected by the RouteActionDetector. |
46 | 47 | */ |
47 | 48 | 'route_action' => 'locale', |
48 | 49 |
|
| 50 | + /** |
| 51 | + * The attribute on the user model that holds the locale, |
| 52 | + * when using the UserDetector. |
| 53 | + */ |
| 54 | + 'user_attribute' => 'locale', |
| 55 | + |
| 56 | + /** |
| 57 | + * The session key that holds the locale, |
| 58 | + * when using the SessionDetector and SessionStore. |
| 59 | + */ |
| 60 | + 'session_key' => 'locale', |
| 61 | + |
| 62 | + /** |
| 63 | + * The name of the cookie that holds the locale, |
| 64 | + * when using the CookieDetector and CookieStore. |
| 65 | + */ |
| 66 | + 'cookie_name' => 'locale', |
| 67 | + |
| 68 | + /** |
| 69 | + * The lifetime of the cookie that holds the locale, |
| 70 | + * when using the CookieStore. |
| 71 | + */ |
| 72 | + 'cookie_minutes' => 60 * 24 * 365, // 1 year |
| 73 | + |
| 74 | + /** |
| 75 | + * The detectors to use to find a matching locale. |
| 76 | + * These will be executed in the order that they are added to the array! |
| 77 | + */ |
| 78 | + 'detectors' => [ |
| 79 | + CodeZero\LocalizedRoutes\Middleware\Detectors\RouteActionDetector::class, |
| 80 | + CodeZero\LocalizedRoutes\Middleware\Detectors\UrlDetector::class, |
| 81 | + CodeZero\LocalizedRoutes\Middleware\Detectors\OmittedLocaleDetector::class, |
| 82 | + CodeZero\LocalizedRoutes\Middleware\Detectors\UserDetector::class, |
| 83 | + CodeZero\LocalizedRoutes\Middleware\Detectors\SessionDetector::class, |
| 84 | + CodeZero\LocalizedRoutes\Middleware\Detectors\CookieDetector::class, |
| 85 | + CodeZero\LocalizedRoutes\Middleware\Detectors\BrowserDetector::class, |
| 86 | + CodeZero\LocalizedRoutes\Middleware\Detectors\AppDetector::class, |
| 87 | + ], |
| 88 | + |
| 89 | + /** |
| 90 | + * Add any of the above detector class names here to make it trusted. |
| 91 | + * When a trusted detector returns a locale, it will be used |
| 92 | + * as the app locale, regardless if it's a supported locale or not. |
| 93 | + */ |
| 94 | + 'trusted_detectors' => [ |
| 95 | + CodeZero\LocalizedRoutes\Middleware\Detectors\RouteActionDetector::class //=> required for scoped config |
| 96 | + ], |
| 97 | + |
| 98 | + /** |
| 99 | + * The stores to store the first matching locale in. |
| 100 | + */ |
| 101 | + 'stores' => [ |
| 102 | + CodeZero\LocalizedRoutes\Middleware\Stores\SessionStore::class, |
| 103 | + CodeZero\LocalizedRoutes\Middleware\Stores\CookieStore::class, |
| 104 | + CodeZero\LocalizedRoutes\Middleware\Stores\AppStore::class, |
| 105 | + ], |
| 106 | + |
49 | 107 | ]; |
0 commit comments