I am not sure I understand the question you are asking. Do you wish to set the created_at date to something different to the current time?
Sep 24, 2020
6
Level 1
Storing date on request in created at entity.
Actually I have Installment management system. system is working perfectly but now i want that when i sell my product i can use any desired date and system automatically generate installments dates in advance. What system is actually doing is getting todays date from carbon and then adding installment difference. below is my code.
$instalment = Instalment::findOrFail($request->instalment_id);
$parIns = round($order->due_amount / $instalment->time);
$tt = '';
for ($i=1;$i<=$instalment->time;$i++){
$insTime['order_instalment_id'] = $orderInss->id;
$insTime['amount'] = $parIns;
$insTime['amount'] = $parIns;
$tt = Carbon::parse($tt)->addDays($instalment->difference);
$insTime['pay_date'] = $tt;
InstalmentTime::create($insTime);
}
Please or to participate in this conversation.