public function withAttribute($attribute, $value) { $new = clone $this; $new->attributes[$attribute] = $value; return $new; }