"Whatever," says Peyton.
I understand the comma needs to be after "whatever" to indicate that is what Peyton is saying but..
Peyton says, "Whatever."
can a period go there because that's all she said or does a comma need to be there as well?
There needs to be a comma if there is a clause following it.
I'm a copy editor, and in AP style, dialogue looks something like this:
"I was excited to hear about Stack Overflow's 10 millionth question," Randall Flagg said. "I only wish I had started answering questions sooner."
If the attribution precedes the quote, than a period (or other punctuation) is just fine:
Fran snorted. "Who'd have guessed?"
Don't double up on question/exclamation marks and commas
"What?" Mom yelled
"What?," Mom yelled.