Support the ongoing development of Laravel.io →
Input Database Eloquent
Last updated 2 years ago.
0

Try

$oKubus->mengsel_temp = $request->get('mengsel_temp');

The Request::get() method will return null if the field was empty. You can also force a return value by setting it as the second parameter.

0

LaurentMeganck said:

Try

$oKubus->mengsel_temp = $request->get('mengsel_temp');

The Request::get() method will return null if the field was empty. You can also force a return value by setting it as the second parameter.

It's still not working. I even tried this:

$oKubus->mengsel_temp =  null;

Which should just store this value as NULL, but somehow it stores it as a 00.0

0

what is type of this field in the database? you have to be sure about its type and also default value.

the decimal field in the database automatically set

Last updated 8 years ago.
0

the type is also decimal in the datebase. here is the migration part of the database:

$table->decimal('mengsel_temp', 3, 1)->nullable();

And I checked it in PHPmyAdmin it really is a decimal field.

0

Sign in to participate in this thread!

Eventy

Your banner here too?

flyhnl flyhnl Joined 17 Jun 2016

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.