https://dev.to/lloyds-digital https://dev.to/rcerljenko Consider building a mobile app (or a website) which connects to a Laravel CMS over API for dynamic content. Now, the app can be a multi-language app which expects to receive a translated content from the CMS.
However, Laravel validation is not aware of this and it always returns validation error messages according to app locale (or fallback locale). Therefore we created a route middleware which groups all API routes and sets app locale based on the lang query param: query('lang'); if ($locale) { app()->setLocale($locale); } return $next($request); }}