B
B
BadassRolf2018-10-10 14:07:14
MySQL
BadassRolf, 2018-10-10 14:07:14

Why doesn't default() work?

In the migration I do the following I start the migration, in the database the line "Default" is "Not set" When saving, it throws an error
$table->string('title')->default(null);
28c535783c.jpg

Integrity constraint violation: 1048 Column 'title' cannot be null

Laravel version is the latest. What kind of nonsense?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
J
JhaoDa, 2018-10-10
@BadassRolf

What's with Laravel? You need to learn SQL.
->nullable(), but not->default(null)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question