Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

1.5K
Views
Type Error in Laravel 8 app when package barryvdh/laravel-translation-manager is installed

For last 3-4 weeks I receive this error in my Laravel 8 app, which breaks down my app. After uninstalling the package the problem disappears.

Please advice.

When using the Laravel app:

TypeError
Argument 2 passed to Symfony\Component\Translation\Translator::addResource() must be an instance of Symfony\Component\Translation\mixed, array given, called in D:\www\MyBooks\vendor\nesbot\carbon\src\Carbon\AbstractTranslator.php on line 165

when updating the app and dependencies:

TypeError

  Argument 2 passed to Symfony\Component\Translation\Translator::addResource() must be an instance of Symfony\Component\Translation\mixed, array given, called in D:\www\MyBooks\vendor\nesbot\carbon\src\Carbon\AbstractTranslator.php on line 165

  at D:\www\MyBooks\vendor\symfony\translation\Translator.php:109
    105|      * @param mixed  $resource The resource name
    106|      *
    107|      * @throws InvalidArgumentException If the locale contains invalid characters
    108|      */
  > 109|     public function addResource(string $format, mixed $resource, string $locale, string $domain = null)
    110|     {
    111|         if (null === $domain) {
    112|             $domain = 'messages';
    113|         }

  1   D:\www\MyBooks\vendor\nesbot\carbon\src\Carbon\AbstractTranslator.php:165
      Symfony\Component\Translation\Translator::addResource("array", "en")

  2   D:\www\MyBooks\vendor\nesbot\carbon\src\Carbon\AbstractTranslator.php:256
      Carbon\AbstractTranslator::resetMessages("en")
over 4 years ago · Santiago Trujillo
2 answers
Answer question

0

I had a similar problem when I tried to use my laravel project today. And I noted that the problem is related to the new version of Symfony "6.x," that only supports php:8.x only. And i downgraded the symfony package with all its dependencies using the following command.

$ composer require symfony/symfony:5.4.x --ignore-platform-reqs

I hope should works but its worked for me.

over 4 years ago · Santiago Trujillo Report

0

composer require symfony/symfony:5.4.x -w --ignore-platform-reqs

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!