array_intersect
laravel/framework
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
)));
}
src/Illuminate/Collections/Collection.php
public function
availableDrivers
()
{
return
array_intersect
(
$this
->
supportedDrivers
(),
str_replace
(
'dblib'
,
'sqlsrv'
,
PDO
::
getAvailableDrivers
())
);
}
src/Illuminate/Database/DatabaseManager.php
} elseif (
count
(
$relations
) ===
1
) {
return
reset
(
$relations
);
} else {
return
array_intersect
(...
array_values
(
$relations
));
}
}
src/Illuminate/Database/Eloquent/Collection.php
$detach
=
array_values
(
array_intersect
(
$this
->
newPivotQuery
()->
pluck
(
$this
->
relatedPivotKey
)->
all
(),
array_keys
(
$records
)
));
if (
count
(
$detach
) >
0
) {
$this
->
detach
(
$detach
,
false
);
src/Illuminate/Database/Eloquent/Relations/Concerns/InteractsWithPivotTable.php
foreach (
$this
->
getAllTables
() as
$row
) {
$row
= (array)
$row
;
if (empty(
array_intersect
(
$this
->
grammar
->
escapeNames
(
$row
),
$excludedTables
))) {
$tables
[] =
$row
[
'qualifiedname'
] ??
reset
(
$row
);
}
}
src/Illuminate/Database/Schema/PostgresBuilder.php
$methods
=
$defaults
;
if (isset(
$options
[
'only'
])) {
$methods
=
array_intersect
(
$methods
, (array)
$options
[
'only'
]);
}
if (isset(
$options
[
'except'
])) {
src/Illuminate/Routing/ResourceRegistrar.php
return
$this
->
hasRule
(
$attribute
,
$this
->
implicitRules
) &&
isset(
$this
->
failedRules
[
$cleanedAttribute
]) &&
array_intersect
(
array_keys
(
$this
->
failedRules
[
$cleanedAttribute
]),
$this
->
implicitRules
);
}
src/Illuminate/Validation/Validator.php