If your created_at field is a timestamp (which is the default), there is no need to do all this, you can feed it directly into Date::time_ago(), since that wants a timestamp.
Date::time_ago($message->created_at);
If it's a MySQL date, you don't need the format() and the strtotime(), since the Date object can give you the timestamp: