You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While looking at the migration of the "Jobs" table, a question came to my mind. As you know, Laravel uses SerializesModels trait to serialize models and their relations when the job is processing. AFAIK, this trait uses PHP's own serialize() function. Here is where the question begins: Laravel uses LONGTEXT data type for migration.
$table->longText("payload");
but PHP recommends BLOB data type for serialize() function's output.
Note that this is a binary string which may include null bytes, and needs to be stored and handled as such. For example, serialize() output should generally be stored in a BLOB field in a database, rather than a CHAR or TEXT field.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
While looking at the migration of the "Jobs" table, a question came to my mind. As you know, Laravel uses SerializesModels trait to serialize models and their relations when the job is processing. AFAIK, this trait uses PHP's own serialize() function. Here is where the question begins: Laravel uses LONGTEXT data type for migration.
$table->longText("payload");
but PHP recommends BLOB data type for serialize() function's output.
Why is Laravel using LONGTEXT instead of BLOB?
Beta Was this translation helpful? Give feedback.
All reactions