Nathan Riley
asked on
Change Date Before DB Insert - Laravel
I'm trying to figure out what the correct way is to modify a date format before inserting when using Laravel 5.4.
I have:
My database mySQL field in datetime, but the date that's passed in the variable is '07/17/2017 3:20 PM'. How/where would I update that before insertion?
I have:
public function store(){
$trip = new Trip;
$trip->tripName = request('tripName');
$trip->departing = request('departing');
$trip->returning = request('returning');
$trip->save();
return $trip;
//return redirect('/home');
}
My database mySQL field in datetime, but the date that's passed in the variable is '07/17/2017 3:20 PM'. How/where would I update that before insertion?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Open in new window