array_intersect

Supported Versions: PHP 4 >= 4.0.1, PHP 5, PHP 7, PHP 8
Computes the intersection of arrays
array_intersect(array $array, array ...$arrays): array
    public function intersect($items)

    {

        return new static(
array_intersect($this->items$this->getArrayableItems($items)));

    }
    public function availableDrivers()

    {

        return 
array_intersect(

            
$this->supportedDrivers(),

            
str_replace('dblib''sqlsrv'PDO::getAvailableDrivers())

        );

    }
        } elseif (count($relations) === 1) {

            return 
reset($relations);

        } else {

            return 
array_intersect(...array_values($relations));

        }

    }
        $detach array_values(array_intersect(

            
$this->newPivotQuery()->pluck($this->relatedPivotKey)->all(),

            
array_keys($records)

        ));



        if (
count($detach) > 0) {

            
$this->detach($detachfalse);
        foreach ($this->getAllTables() as $row) {

            
$row = (array) $row;



            if (empty(
array_intersect($this->grammar->escapeNames($row), $excludedTables))) {

                
$tables[] = $row['qualifiedname'] ?? reset($row);

            }

        }
        $methods $defaults;



        if (isset(
$options['only'])) {

            
$methods array_intersect($methods, (array) $options['only']);

        }



        if (isset(
$options['except'])) {
        return $this->hasRule($attribute$this->implicitRules) &&

               isset(
$this->failedRules[$cleanedAttribute]) &&

               
array_intersect(array_keys($this->failedRules[$cleanedAttribute]), $this->implicitRules);

    }