You can use the function in_array, as usual, in a regular php file without using the blade template language. In your view, something.blade.phpyou can do something like:
<?php
if (in_array($something, $an_array)) {
echo "Yes";
}
?>
If you want to use the function in_arrayinside the if statement, you can use the blade template syntax for the if statement, for example:
@if (in_array($something, $an_array))
<span>Something</div>
@endif
in_array php- . in_array , , .