Support the ongoing development of Laravel.io →
posted 8 years ago
Input
Last updated 5 months ago.
0

Your problem is here:

$days1 = implode(',', Input::get('days'));

This gets converted to string "8.4"

Then when you run

$query->whereIn('days', array($days1))->orderBy('days', 'asc');

array($days1) converts "8.4" to

Array
(
    [0] => 8,4
)

8,4 then gets converted to an int to match the column in your db. (int)8,4 = 8

Hence only rows with 8.

So either don't implode at the start, or explode(",", $days1) instead of array($days1);

Makes sense?

Last updated 5 months ago.
0

Already solved this ...

As the same way, as You proposed.

Thanks !

Last updated 5 months ago.
0

Sign in to participate in this thread!

Cloudways

Your banner here too?

goranata goranata Joined 12 Mar 2014

Moderators

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

Your logo here?

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

© 2022 Laravel.io - All rights reserved.