Currently, I am writing a laravel application with a part for sending messages between the staff at the company and the clients.
So, I have a field named "status" in the database. In this field, a value of one indicates that the message is waiting for an answer, a value of two indicates that it has been answered, and a value of three indicates that the message has been closed. There is a problem here, however. It's not clear what these numbers do when someone looks at my code.
Would there be any way for me to define this number or any other way to make my code more readable?
(I'm using laravel eloquent ORM)
The code below is for the method that closes a conversation:
public function close(Request $request)
{
$message = Message::find($request->message_id);
// Status one indicates that a conversation has been closed
$message->status = 1;
$message->save();
return \response($message, 200);
}