lundi 30 septembre 2019

Laravel support collection not works on the timing have any solution?

Laravel support collection does not work with the date and time. how can I solve it?

$timings = collect([]);

for ($i = 1; $i < 24 ; $i++) {
    $timings->push([
        'start_time' => $i.':50:34'
    ]);
}

Above loop is for the generate 24 hours timings for the example.

When we make this then works fine but include unnecessary timings also.

$timings->where('start_time', '<=', '11:59:59')->where('start_time', '>=', '00:00:00');
$timings->where('start_time', '>=', '12:00:00')->where('start_time', '<=', '23:59:59');

Please help me with this.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire