kartavik/limit-collection

Base collection with limit size option

1.0.1 2019-07-15 13:02 UTC

This package is auto-updated.

Last update: 2024-04-13 01:13:04 UTC


README

codecov Latest Stable Version Total Downloads License

Based on BaseCollection

Install

composer require kartavik/limit-collection

Usage

<?php

use Kartavik\LimitCollection;

class CustomCollection extends LimitCollection
{
    public function type() : string
    {
        return stdClass::class; // see Wearesho\BaseCollection
    }
    
    public function limit() : int
    {
        return 5; // here you can put hardcode limit of collection
    }
}

Author

License