src/Conductors/Concerns/ConductsAbilities.php
protected function shouldConductLazy($abilities)
    {
        // We'll only create a lazy conductor if we got a single
        // param, and that single param is either a string or
        // a numerically-indexed array (of simple strings).
        if (func_num_args() > 1) {
            return false;
        }

        if (is_string($abilities)) {
            return true;
        }

        if (! is_array($abilities) || ! Helpers::isIndexedArray($abilities)) {
            return false;
        }

        // In an ideal world, we'd be using $collection->every('is_string').
        // Since we also support older versions of Laravel, we'll need to
        // use "array_filter" with a double count. Such is legacy life.
        return count(array_filter($abilities, 'is_string')) == count($abilities);
    }
protected function shouldConductLazy($abilities)
    {
        // We'll only create a lazy conductor if we got a single
        // param, and that single param is either a string or
        // a numerically-indexed array (of simple strings).
        if (func_num_args() > 1) {
            return false;
        }

        if (is_string($abilities)) {
            return true;
        }

        if (! is_array($abilities) || ! Helpers::isIndexedArray($abilities)) {
            return false;
        }

        // In an ideal world, we'd be using $collection->every('is_string').
        // Since we also support older versions of Laravel, we'll need to
        // use "array_filter" with a double count. Such is legacy life.
        return count(array_filter($abilities, 'is_string')) == count($abilities);
    }
protected function shouldConductLazy ( $ abilities ) { // We'll only create a lazy conductor if we got a single // param, and that single param is either a string or // a numerically-indexed array (of simple strings). if ( func_num_args ( ) > 1 ) { return false ; } if ( is_string ( $ abilities ) ) { return true ; } if ( ! is_array ( $ abilities ) || ! Helpers :: isIndexedArray ( $ abilities ) ) { return false ; } // In an ideal world, we'd be using $collection->every('is_string'). // Since we also support older versions of Laravel, we'll need to // use "array_filter" with a double count. Such is legacy life. return count ( array_filter ( $ abilities , 'is_string' ) ) == count ( $ abilities ) ; }
Determines whether a call to "to" with the given parameters should be conducted lazily.

@param  mixed  $abilities
@param  mixed  $model
@return bool
Determines whether a call to to with the given parameters should be conducted lazily .