@@ -12,7 +12,7 @@ class Translatable
1212 /**
1313 * Check if the provided locale is within the supported locales.
1414 *
15- * @param string $locale The locale to check.
15+ * @param string $locale The locale to check.
1616 */
1717 public function checkLocaleInSupportedLocales (string $ locale ): bool {
1818 $ locales = config ('translatable.locales ' );
@@ -43,7 +43,7 @@ public function getLocaleFromRequest(): string {
4343 /**
4444 * Check if the provided locale is the fallback locale.
4545 *
46- * @param string $locale The locale to check.
46+ * @param string $locale The locale to check.
4747 */
4848 public function isFallbackLocale (string $ locale ): bool {
4949 return config ('translatable.fallback_locale ' ) === $ locale ;
@@ -59,13 +59,13 @@ public function isFallbackLocaleHidden(): bool {
5959 /**
6060 * Given a route name or path, return it localized if possible.
6161 *
62- * @param string $name The route name or path to localize.
63- * @param mixed $parameters The route parameters.
64- * @param bool $absolute Whether to return an absolute URL.
65- * @param string|null $locale The locale to use.
62+ * @param string $name The route name or path to localize.
63+ * @param mixed $parameters The route parameters.
64+ * @param bool $absolute Whether to return an absolute URL.
65+ * @param string|null $locale The locale to use.
6666 * @return string The localized route.
6767 */
68- public function route (string $ name , $ parameters = [], bool $ absolute = false , string $ locale = null ): string {
68+ public function route (string $ name , $ parameters = [], bool $ absolute = false , ? string $ locale = null ): string {
6969 $ name = $ this ->stripLocaleFromRouteName ($ name );
7070
7171 $ currentLocale = $ this ->getLocaleFromRequest ();
@@ -108,7 +108,7 @@ public function route(string $name, $parameters = [], bool $absolute = false, st
108108 /**
109109 * Get the current path localized with the provided locale.
110110 *
111- * @param string $locale The locale to use.
111+ * @param string $locale The locale to use.
112112 * @return string The localized path.
113113 */
114114 public function switchToLocale (string $ locale ): string {
@@ -141,7 +141,7 @@ public function switchToLocale(string $locale): string {
141141 /**
142142 * Strip the locale from the beginning of a route name.
143143 *
144- * @param string $name The route name to strip.
144+ * @param string $name The route name to strip.
145145 * @return string The stripped route name.
146146 */
147147 protected function stripLocaleFromRouteName (string $ name ): string {
0 commit comments