2017-25 © Pedro Peláez
 

library counter

Simple indexed looping

image

cupoftea/counter

Simple indexed looping

  • Thursday, September 15, 2016
  • by CupOfTea696
  • Repository
  • 1 Watchers
  • 0 Stars
  • 170 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 6 Versions
  • 4 % Grown

The README.md

Latest Stable Version Total Downloads Latest Unstable Version StyleCI License, (*1)

Counter

Simple indexed looping.

Easily loop over any Traversable or Array while keeping track of the index. It will also accept any other variable types, and cast those to an array., (*2)

With Counter you can both keep track of the current index and iteration while traversing any variable, regardless of which keys are being used. In addition to that, Counter also provides a stack of useful methods to check if the current iteration matches set requirements, for example Counter::first() and Counter::even()., (*3)

Quickstart

$ composer require cupoftea/counter ^1.0

Laravel integration

Add the Counter ServiceProvider to your config/app.php., (*4)

    'providers' => [

        /*
         * Laravel Framework Service Providers...
         */

        'Illuminate\Foundation\Providers\ArtisanServiceProvider',
        'Illuminate\Auth\AuthServiceProvider',
        'Illuminate\Bus\BusServiceProvider',

        ...

        'CupOfTea\Counter\CounterServiceProvider',

    ],

Optionally you can also add the Counter Facade if you wish to use it., (*5)

    'aliases' => [

        'App'       => 'Illuminate\Support\Facades\App',
        'Artisan'   => 'Illuminate\Support\Facades\Artisan',
        'Auth'      => 'Illuminate\Support\Facades\Auth',

        ...

        'Counter' => 'CupOfTea\Counter\Facades\Counter',

    ],

The Versions

15/09 2016

dev-master

9999999-dev

Simple indexed looping

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar CupOfTea696

15/09 2016

v1.1.0

1.1.0.0

Simple indexed looping

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar CupOfTea696

08/03 2016

v1.0.3

1.0.3.0

Simple indexed looping

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar CupOfTea696

26/01 2016

v1.0.2

1.0.2.0

Simple indexed looping

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar CupOfTea696

25/01 2016

v1.0.1

1.0.1.0

Simple indexed looping.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar CupOfTea696

25/01 2016

v1.0.0

1.0.0.0

Simple indexed looping.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar CupOfTea696