mardi 9 août 2016

Combine multiple field input into single value in Laravel

here I would like to combine two input fields, how can I combine the date_start and my time into single value in laravel. (my field type : datetime)

here my script for view:

<div class="form-group date" style="float: left;">
    <label for="">Date</label>
        <input class="form-control tanggal" id="date" name="date_start"  placeholder="YYYY-MM-DD" type="text" required />
    </div>
    <div class="form-group time" style="float: right;">
    <label for="">Time</label>
        <input type="time" name="time" placeholder="what time" class="form-control" id="time" />
    </div>

and this my controller :

$a['date_start']    = Session::get('date_start').  Session::get('time');

i ve been try to running it, and i get result array like this,

Array ( [date_start] => 2016-08-1001:00 )

i think its right but in my database its still 0000-00-00 00:00:00

what improvements do i have to make to the code to achieve my goal?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire