You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If LocaleCookieRedirect is added to the Kernel, it throws exception when returning BinaryFileResponse, which does not have "withCookie" method at line 30
Current work around :
Create a new class by copy & paste LocaleCookieRedirect
Check and bypass if withCookie method does not exist
Replace LocaleCookieRedirect with the newly created class in Kernel.php
if (\count($params) > 0 && app('laravellocalization')->checkLocaleInSupportedLocales($params[0])) {
$response = $next($request);
if (method_exists($response, 'withCookie')) {
return $response->withCookie(cookie()->forever('locale', $params[0]));
} else {
return $response;
} // end of if
} // end of if
The text was updated successfully, but these errors were encountered:
@ridea-co yes your right. BinaryFileResponse does not have a withCookie method.
Instead of a if-else, we should just use $response->headers->set(...) because this works for BinaryFileResponse aswell for the default Laravel repsonse.
If LocaleCookieRedirect is added to the Kernel, it throws exception when returning BinaryFileResponse, which does not have "withCookie" method at line 30
Current work around :
The text was updated successfully, but these errors were encountered: