public function deleteProduct($p_id, $p_details) { if (count($p_details) == 0) { $p_details = Product::whereRaw('id = ?', array($p_id))->first(); } //To update product status to deleted $affected_rows = Product::where('id', '=', $p_id)->update(array('product_status' => 'Deleted')); if ($affected_rows) { //To update user total products count ProductService::updateUserTotalProducts($p_details['product_user_id']); return true; } return false; }