Laravel 8 Str::contains() {#collection-method}
Str::contains
方法判断指定字符串中是否包含另一指定字符串(区分大小写):
use Illuminate\Support\Str;
$contains = Str::contains('This is my name', 'my');
// true
您亦可以传递数组的值的形式来判断指定字符串是否包含数组中的任一值:
use Illuminate\Support\Str;
$contains = Str::contains('This is my name', ['my', 'foo']);
// true