How to create an empty collection in illuminate/collections?

To create an empty collection in the Illuminate/Collections package, you can use the collect function and pass an empty array or simply call the collect function without any argument. Here are two ways to create an empty collection:

  1. Pass an empty array to the collect function:
$collection = collect([]);
  1. Call the collect function without any argument:
$collection = collect();

Both of these methods will create an empty collection that you can use to add items dynamically.