What is the difference between:
$table->string('some_text');
and:
$table->text('some_text');
in Laravel?
Please, if you can be comprehensive. Thank you.
As defined here:
$table->string()
uses a VARCHAR equivalent
$table->text()
uses a TEXT equivalent
(The actual types can depend on the database system)
The obvious difference is that VARCHAR has a specified length (default with string()
is 255 characters) whereas TEXT doesn't have that.
Here is a comparison of the two types in MySQL
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With