My Idea is that the return values of some functions should be Collections instead of regular arrays.
This adds some more functionality to them and integrates it better into Laravel.
Example:
// In Class Exlo89\LaravelSevdeskApi\Api\Contact;
public function all(int $depth = 0)
{
// Only difference is the Collection::make()
return Collection::make($this->_get(Routes::CONTACT, ['depth' => $depth]));
}
$sevdeskapi = Sevdesk::make();
$contacts = $sevdeskApi->contact()->all()
$contacts->first() // now possible since it is a collection
My Idea is that the return values of some functions should be Collections instead of regular arrays. This adds some more functionality to them and integrates it better into Laravel.
Example:
Maybe there is a smoother way to achive this.