0
I recommend that you remove the score before storing these values, it will facilitate comparisons, searches and any other operation involving this column.
To solve your problem, you can use the attribute casting
eloquent model. Within your model class, try to define the casts
as a array
, and within it his field as string
, for example:
/**
* The attributes that should be casted to native types.
*
* @var array
*/
protected $casts = [
'cnpj' => 'string',
];
If you still don’t solve it, try modifying your Migration to use the method string
, thus:
Schema::create('customers', function (Blueprint $table) {
....
$table->string('cnpj', 14)->nullable();
....
}
For more information you can visit official documentation of Laravel on attribute casting
.
would have an excerpt from your code to demonstrate how you are performing the request ?
– Fbor