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

Most likely, this is happening because array indexes can't be floats. Floats are truncated to integer values. This will change your data structure a bit, but you could try this and adjust rendering it accordingly.

$discounts = Discount::get(['dis_id', 'percentage'])->toArray();
array_unshift($discounts, ['p' => 'Select Percentage']);
0

Nope it does not work :(

0

Sign in to participate in this thread!

Eventy

Your banner here too?

AtomicRSA atomicrsa Joined 24 Jun 2015

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.