I have a function of this
function notifyStore($storeId, $notification,$type, $link)
{
$notify = new App\Store_notification;
$notify->store_id = $storeId;
$notify->notification = $notification;
$notity->link = $link;
$notify->type = $type;
$notify->save();
}
And in Controller
$order = new Store_order;
$orderArray['user_id'] = $signed['user_id'];
$orderArray['store_id'] = $store->store_id;
$orderArray['payment_method'] = $signed['payment_id'];
$orderArray['address_info'] = $signed['address'];
$orderArray['invoice_id'] = $signed['invoice_id'];
$orderArray['order_status'] = 2;
$orderArray['created_at'] = Carbon::now()->format('Y-m-d H:i:s');
$invoice = $order->insertGetId($orderArray);
notifyStore($store->store_id,"You have a order to review",3,$signed['invoice_id']);
But every time I submit order it generates this error. I don't know what's wrong with it. It says error on line 74 and the line 74 is $notity->link = $link;
. Can anyone please check and tell me what's wrong?
Error
at HandleExceptions->handleError(2, 'Creating default object from empty value', 'C:\\wamp64\\www\\ABCProject\\app\\Http\\Helper.php', 74, array('storeId' => 1, 'notification' => 'You have a order to review', 'type' => 3, 'link' => '2017-1-6-888-8280', 'notify' => object(Store_notification), 'notity' => object(stdClass))) in Helper.php line 74
via Alen