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