Laravel: String data, right truncated: 1406 Data too long for column : <p>I have a table with a column 'hotel'. The project is created in Laravel 5.4, so I used Migrations. </p>

<pre><code>    $table-&gt;string('hotel', 50);
</code></pre>

<p>This is MYSQL VARCHAR (50). It was working good, because when I was developing I used short hotel names like <em>"HILTON NEW YORK 5</em>"*. </p>

<p>Now the project is on production and customer asked why they can't input long hotel names. I've tested it with such a mock hotel name as <em>"Long long long long long long long long long and very-very-very long hotel name 5 stars"</em></p>

<p>It gave me an error:</p>

<blockquote>
  <p>"SQLSTATE[22001]: String data, right truncated: 1406 Data too long for
  column 'hotel' at row 1"</p>
</blockquote>

<p>I've opened database in my Sequel Pro and changed it</p>

<ul>
<li>first to VARCHAR (255) </li>
<li>then to TEXT</li>
</ul>

<p>After each change I tested it with the same "Long long long long long long long long long and very-very-very long hotel name 5 starts" and get the same error (see above).</p>

<p>I've checked the type of column with </p>

<pre><code>SHOW FIELDS FROM table_name
</code></pre>

<p>and it gave me </p>

<blockquote>
  <p>Field | Type</p>
  
  <p>hotel | text</p>
</blockquote>

<p>so the type of the field is 'text' indeed  (65 535 characters). </p>

<p>Maybe it's somehow connected with Laravel Migration file (see above) where I set VARCHAR (50) in the beginning? But I can't re-run migration on production, because the table has data now. </p>

<p>Would appreciate any help.</p>

<hr>

<p><strong>UPDATE:</strong>
I discovered that it actually saves that long hotel name in the DB. But user still gets this annoying mistake every time after submitting the form...</p>
