title: Unexpected behavior of Laravel 5.4 pluck after migration
body: <h2>Introduction</h2>
  <blockquote>
  <h4> <strong>Please:</strong> Look at the <strong>Update</strong> and the <strong>Conclusion</strong> at the end below first.</h4>
  </blockquote>
  <p>I have <a href="/questions/tagged/laravel-5.4" class="post-tag" title="show questions tagged &#39;laravel-5.4&#39;" rel="tag">laravel-5.4</a> app that runs fine on the following software configurations:</p>
  <blockquote>
  <ul>
  <li>Kubuntu 20.04</li>
  <li>PHP 7.4.29 from Onrej PPA</li>
  <li>Apache, installed from the distro repos. Using <strong>mod_php</strong></li>
  <li>Laravel 5.4</li>
  <li>MySQL 5.7 runs from Docker container.</li>
  </ul>
  </blockquote>
  <p>I migrated this app to new OS, Kubuntu <strong>22.04</strong>, (I have dual boot on my PC), by copying all the project's files except, <strong>vendor</strong> and <strong>node_modules</strong> then I used composer to restore all required dependencies. The software configurations becomes:</p>
  <blockquote>
  <ul>
  <li>Kubuntu <strong>22.04</strong></li>
  <li>PHP 7.4.29 from Onrej PPA &gt; <em>The same</em></li>
  <li>Apache, installed from the distro repos. version 2.4.52 Using <strong>FPM/FastCGI</strong></li>
  <li>Laravel 5.4 &gt; <em>The same</em></li>
  <li>MySQL ver 8.0.28 installed from the OS repos.</li>
  </ul>
  </blockquote>
  <p>In the migrated app, I had to add <code>modes</code> directive to <code>config/database.php</code> in MySQL connection data to prevent the following fatal error:</p>
  <blockquote>
  <p>dev.ERROR: PDOException: SQLSTATE[42000]: Syntax error or access
  violation: 1231 Variable 'sql_mode' can't be set to the value of
  'NO_AUTO_CREATE_USER' in
  /home/user/www/app2-vn/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:105</p>
  </blockquote>
  <p>Like the following:</p>
  <pre><code>'connections' =&gt; [
  
          'sqlite' =&gt; [
              'driver' =&gt; 'sqlite',
              'database' =&gt; env('DB_DATABASE', database_path('database.sqlite')),
              'prefix' =&gt; '',
          ],
  
          'mysql' =&gt; [
              'driver' =&gt; 'mysql',
              'host' =&gt; env('DB_HOST', 'localhost'),
              'port' =&gt; env('DB_PORT', '3306'),
              'database' =&gt; env('DB_DATABASE', 'app2'),
              'username' =&gt; env('DB_USERNAME', 'user1'),
              'password' =&gt; env('DB_PASSWORD', 'P@55v0'),
              'charset' =&gt; 'utf8mb4',
              'collation' =&gt; 'utf8mb4_unicode_ci',
              'prefix' =&gt; '',
              'strict' =&gt; true, //true
              'engine' =&gt; null,
              'timezone'  =&gt; '+02:00',
              'version'  =&gt; 8,
              'modes'  =&gt; [
            /*  'ONLY_FULL_GROUP_BY',*/
             /* 'STRICT_TRANS_TABLES',*/
            /*  'NO_ZERO_IN_DATE',*/
             /* 'NO_ZERO_DATE',*/
             /* 'ERROR_FOR_DIVISION_BY_ZERO',*/
             /* 'NO_ENGINE_SUBSTITUTION',*/
          ],
          ],
  </code></pre>
  <p><strong>By the way</strong>, as shown above, an empty <code>modes</code> just fine to make the application works!</p>
  <h2>The Issue</h2>
  <p>I have used pluck like the following:</p>
  <pre><code>$eqtypes = \App\Eqtype::get()-&gt;pluck('title','id');
  dd($eqtypes,\App\Eqtype::get());
  </code></pre>
  <p>In the original app, it works fine with output:</p>
  <pre><code>Collection {#1279 ▼
    #items: array:3 [▼
      1 =&gt; 'Mold'
      2 =&gt; 'Plank'
      3 =&gt; 'Neck'
    ]
  }
  </code></pre>
  <p><strong>But</strong> in the migrated app it returns null for the keys values:</p>
  <pre><code>Collection {#1279 ▼
    #items: array:3 [▼
      1 =&gt; null
      2 =&gt; null
      3 =&gt; null
    ]
  }
  </code></pre>
  <p>I am very confused, the same code base, the same PHP version and the same framework version, but different result!
  I tried to look for any compatibility issue between Laravel 5.4 and MySQL 8, but I could not find anything. <strong>What do you think the cause of this issue?</strong></p>
  <h1>Update:</h1>
  <p>It looks like dependency issue, after replacing <code>vendor</code> directory generated by composer, with the <code>vendor</code> of original app by copying it directly, it works fine as expected.</p>
  <p>I have translation model package called <code>Dimsav\Translatable\TranslatableServiceProvider::class,</code> I think it causes some model values to be null in English and I don't remember if I modified it to allow default fallback translation that returns the default string or not. <a href="https://github.com/dimsav/laravel-translatable/issues/409" rel="nofollow noreferrer">This is an issue</a> I submitted there from Oct. 2017 and I think my original app vendor has hard code modification that I have suggested there.</p>
  <h1>Conclusion</h1>
  <p>The issue is not related to the framework, PHP, or the database. It is missing hard coded a package's class.</p>