Issue
i've form has 2 inputs date/time but its static i have an idea but don't know if its applicable or not.
i want the 2 inputs have default now();
if the didn't change its value it stored to db with the now(); date and time,
but if he changed it to another date and time the stored value be his choice,
is this can be done ?
Solution
use laravel helper function
now()
also you have use carbon class:
Carbon\Carbon::now()
this is an example:
$data = array("name" => $name,"address" => $address,"created_at"=> Carbon::now(),"updated_at"=> now());
DB::table('student')->insert($data);
Answered By - a bcd Answer Checked By - Mildred Charles (PHPFixing Admin)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.