vendor/laravel/framework/src/Illuminate/Support/Collection.php
/**
     * Create a new collection by invoking the callback a given amount of times.
     *
     * @param  int  $number
     * @param  callable  $callback
     * @return static
     */
Create a new collection by invoking the callback a given amount of times.
@param  int  $number
@param  callable  $callback
@return static
Create a new collection by invoking the callback a given amount of times . @param int $number @param callable $callback @return static
public static function times($number, callable $callback = null)
    {
        if ($number < 1) {
            return new static;
        }
        if (is_null($callback)) {
            return new static(range(1, $number));
        }
        return (new static(range(1, $number)))->map($callback);
    }
public static function times ( $ number , callable $ callback = null ) { if ( $ number < 1 ) { return new static ; } if ( is_null ( $ callback ) ) { return new static ( range ( 1 , $ number ) ) ; } return ( new static ( range ( 1 , $ number ) ) ) -> map ( $ callback ) ; }
Create a new collection by invoking the callback a given amount of times.
Create a new collection by invoking the callback a given amount of times .