File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -29,6 +29,21 @@ public function __construct(array $data = [])
2929 $ this ->data = $ data ;
3030 }
3131
32+ /**
33+ * Create a new instance of the collection from the given data.
34+ *
35+ * This method acts as a wrapper around the `make` method,
36+ * allowing for the creation of a collection instance using
37+ * the provided data. The data is processed to ensure it is
38+ * in an array format suitable for the collection.
39+ *
40+ * @param mixed $data The data to initialize the collection with.
41+ * @return static A new instance of the collection.
42+ */
43+ public static function from (mixed $ data ): static
44+ {
45+ return static ::make ($ data );
46+ }
3247
3348 /**
3449 * Create a new instance of the collection with the given data.
@@ -46,7 +61,6 @@ public static function make(mixed $data): static
4661 return $ instance ;
4762 }
4863
49-
5064 /**
5165 * Dynamically handle calls to methods on the collection.
5266 *
You can’t perform that action at this time.
0 commit comments