You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/config.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -83,12 +83,12 @@ php artisan vendor:publish
83
83
Meaning of parameters:
84
84
85
85
*`handler` (mandatory) specifies a full name of the class implementing `ConverterContract`. Object of that class will be
86
-
instantiated and conversion method will be invked with object given as argument. The `key` is a string that will be used
86
+
instantiated and conversion method will be invoked with object given as argument. The `key` is a string that will be used
87
87
as the JSON response as key to array representation when object of that class is passed as direct payload
88
88
(i.e. `success($object);`). Note, that `key` is not used otherwise, so if you have i.e. array of objects, they will be
89
89
properly converted without `key` used.
90
-
*`key` (mandatory) is a string, used by some converters when dealing with object of given class being returned directly
91
-
as response payload (i.e. `success($collection)`).
90
+
*`key` (mandatory) can be a string or `NULL`. A string is useful for some converters when dealing with an object of a given class being returned directly
91
+
as response payload (i.e. `success($collection)`). Otherwise `NULL` can be used to tell `ResponseBuilder` to return object directly, which may be useful.
92
92
*`pri` (optional) is an integer being entry's priority (default `0`). Entries with higher values will be matched first. If you got one
93
93
class extending another and you want to support both of them with separate configuration, then you **must** ensure child
0 commit comments