src/Model.php
public static function collection($records = [], Fields $fields = null, $flags = Resource::PARSE_DEFAULT)
    {
        return Resource::parseFromRecords(
            $records,
            static::class,
            $fields,
            $flags
        );
    }
public static function collection($records = [], Fields $fields = null, $flags = Resource::PARSE_DEFAULT)
    {
        return Resource::parseFromRecords(
            $records,
            static::class,
            $fields,
            $flags
        );
    }
public static function collection ( $ records = [ ] , Fields $ fields = null , $ flags = Resource :: PARSE_DEFAULT ) { return Resource :: parseFromRecords ( $ records , static :: class , $ fields , $ flags ) ; }
Prepare a collection of resources
@param  array[]|object[] $records Multiple records fetched from database
[Optional] Write resource and relationship links, defaults is false
@param Fields|null $fields
@param int $flags
@return Resource[]
@uses Resource::parseFromRecords
@example
```php
Model::collection([
[
'id' => '10',
'title' => 'Hello world'
]
]);
```
Prepare a collection of resources