@ryleigh
To save an empty string in the database using Laravel, you can do the following:
1
|
$table->string('column_name')->nullable(); |
1 2 3 |
$model = new Model(); $model->column_name = ''; $model->save(); |
By setting the column as nullable in the migration file, you allow the column to accept NULL values. So when you set an empty string value, Laravel will save it as NULL in the database.