public function bypassCheckpoints(Closure $callback, $checkpoints = [])
    {
        $originalCheckpoints = $this->checkpoints;

        $activeCheckpoints = [];

        foreach (array_keys($originalCheckpoints) as $checkpoint) {
            if ($checkpoints && ! in_array($checkpoint, $checkpoints)) {
                $activeCheckpoints[$checkpoint] = $originalCheckpoints[$checkpoint];
            }
        }

        // Temporarily replace the registered checkpoints
        $this->checkpoints = $activeCheckpoints;

        // Fire the callback
        $result = $callback($this);

        // Reset checkpoints
        $this->checkpoints = $originalCheckpoints;

        return $result;
    }
public function bypassCheckpoints(Closure $callback, $checkpoints = [])
    {
        $originalCheckpoints = $this->checkpoints;

        $activeCheckpoints = [];

        foreach (array_keys($originalCheckpoints) as $checkpoint) {
            if ($checkpoints && ! in_array($checkpoint, $checkpoints)) {
                $activeCheckpoints[$checkpoint] = $originalCheckpoints[$checkpoint];
            }
        }

        // Temporarily replace the registered checkpoints
        $this->checkpoints = $activeCheckpoints;

        // Fire the callback
        $result = $callback($this);

        // Reset checkpoints
        $this->checkpoints = $originalCheckpoints;

        return $result;
    }
public function bypassCheckpoints ( Closure $ callback , $ checkpoints = [ ] ) { $ originalCheckpoints = $ this -> checkpoints ; $ activeCheckpoints = [ ] ; foreach ( array_keys ( $ originalCheckpoints ) as $ checkpoint ) { if ( $ checkpoints && ! in_array ( $ checkpoint , $ checkpoints ) ) { $ activeCheckpoints [ $ checkpoint ] = $ originalCheckpoints [ $ checkpoint ] ; } } // Temporarily replace the registered checkpoints $ this -> checkpoints = $ activeCheckpoints ; // Fire the callback $ result = $ callback ( $ this ) ; // Reset checkpoints $ this -> checkpoints = $ originalCheckpoints ; return $ result ; }
Pass a closure to Sentinel to bypass checkpoints.

@param  \Closure  $callback
@param  array  $checkpoints
@return mixed
Pass a closure to Sentinel to bypass checkpoints .