Error thrown

Call to a member function switch_to_locale() on null