Actually I am trying to save the same data again in the database. So I retrieved the value from the db and then tried to save it again. But I am getting an error when I call the save function.
Symfony \ Component \ Debug \ Exception \ FatalErrorException (E_ERROR)
Call to undefined method stdClass::save()
Open: C:\xampp\htdocs\psi-aims\app\models\Orders.php
public static function updateByOrderId($orderId)
{
/**
* Copy the Original Row with statusId As INACTIVE and refId AS PRIMARY KEY
**/
$currentOrders = Orders::getForCopy($orderId);
$currentOrders->mstStatus_id = 2;
$currentOrders->save();
what does "getForCopy" do?
$currentOrders = Orders::getForCopy($orderId);
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community