public function getTransactionDetailsById($ticketId) { $result = Transaction::whereId($ticketId)->first(); //first() function in sql returns the first value of the selected column return $result; }