tobya/every

Execute a closure every count times the function is called

Maintainers

Details

github.com/tobya/Every

Source

Issues

Installs: 2 986

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 2

pkg:composer/tobya/every

v0.4 2024-02-07 08:12 UTC

This package is auto-updated.

Last update: 2025-10-07 11:49:27 UTC


README

A very simple Laravel package that will execute a closure every x times it is called.

Installation

Install with composer

composer require tobya/every

Usage

use in a loop to execute every x times

 foreach( $BigList as $item){
    if (DoACheck()){
      DoSomethign();
    }
    \Tobya\Every\Every::Every(20, function(){
        echo 'checked 20';
      });
  }

if you just want to echo you can simply use the echo function

 foreach( $BigList as $item){
    if (DoACheck()){
      DoSomethign();
    }
    \Tobya\Every\Every::Echo(20, 'checked 20');
      
  }