title: How Do I resolve "Illuminate\Queue\InvalidPayloadException: Unable to JSON encode payload. Error code: 5"
body: <p>Trying out the queue system for a better user upload experience with Laravel-Excel.</p>
  <p>.env was been changed from 'sync' to 'database' and migrations run. All the necessary use statements are in place yet the error above persists.</p>
  <p>The exact error happens here:</p>
  <pre><code>Illuminate\Queue\Queue.php:97
          $payload = json_encode($this-&gt;createPayloadArray($job, $queue, $data));
                  if (JSON_ERROR_NONE !== json_last_error()) {
                              throw new InvalidPayloadException(
  </code></pre>
  <p>If I drop ShouldQueue, the file imports perfectly in-session (large file so long wait period for user.)</p>
  <p>I've read many stackoverflow, github etc comments on this but I don't have the technical skills to deep-dive to fix my particular situation (most of them speak of UTF-8 but I don't if that's an issue here; I changed the excel save format to UTF-8 but it didn't fix it.)</p>
  <p>Ps. Whilst running the migration, I got the error:</p>
  <pre><code>SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes (SQL: alter table `jobs` add index `jobs_queue_index`(`queue`))
  </code></pre>
  <p>I bypassed by dropping the 'add index'; so my jobs table is not indexed on queue but I don't feel this is the cause.</p>