I have a field in my database that stores a decimal value. It's defined in my database migration as such:
$table->decimal('buy_amount', 16, 8)->default(0); Now reading from the database using Laravel Eloquent it returns a string value instead. According to the documentation, I tried casting it in the model file using the $casts array however it makes no difference. It's worth mentioning that every other cast works fine except for decimals.
protected $casts = [ 'buy_amount' => 'decimal:8', ]; This is the result I get:
What am I missing?
