Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion src/Collection/BaseCollectionTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,21 @@ public function __construct(array $data = [])
$this->data = $data;
}

/**
* Create a new instance of the collection from the given data.
*
* This method acts as a wrapper around the `make` method,
* allowing for the creation of a collection instance using
* the provided data. The data is processed to ensure it is
* in an array format suitable for the collection.
*
* @param mixed $data The data to initialize the collection with.
* @return static A new instance of the collection.
*/
public static function from(mixed $data): static
{
return static::make($data);
}

/**
* Create a new instance of the collection with the given data.
Expand All @@ -46,7 +61,6 @@ public static function make(mixed $data): static
return $instance;
}


/**
* Dynamically handle calls to methods on the collection.
*
Expand Down