I am trying to get order collection by order id in Magento 2.
Here is my code:
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$orders = $objectManager->create('Magento\Sales\Model\Order')->getCollection()->load($oid);
echo $custLastName= $orders->getCustomerLastname();
But its is giving fatal error:
Call to undefined method Magento\Sales\Model\ResourceModel\Order\Collection::getCustomerLastname()
$orders = $objectManager->create('Magento\Sales\Model\Order')->load($oid);