What turned out to be the last order of the night — before an attack left a police officer with injuries, a suspect in custody and a Halal Paradise food truck in shambles — came from a man with $4 in his hand and a $5 lamb gyro on his brain.

“I tell him, ‘No big deal, I do it for you,’” said Imam Hassanian, 23, who was working in the truck that night — or morning, technically, almost three hours past midnight on Feb. 26. He turned to the grill.

Most of New York City’s many food trucks and carts are tucked away in garages at that hour, leaving Mr. Hassanian with little competition. He had settled onto his corner at North Seventh Street and Bedford Avenue in Williamsburg, Brooklyn, three months ago. There was a subway station and a bar just outside the truck, and many more bars in the surrounding blocks.

Mr. Hassanian liked working nights for a reason that had nothing to do with the job. It allowed him to talk to his wife, Nasma. She lives in Cairo, where the time is seven hours ahead. They were married last year, and he hopes to bring her to New York soon.