Thanks, I'd already figure out what happened. Because The version of Laravel is different between local and online. the parameter in Laravel 5.3 and 5.2 collection where() are different.
____ This is what show in tinker on Windows/Mac [ Laravel 5.3 ]___
>>> $a = collect([['a'=>1,'b'=>2],['a'=>'1','b'=>3]])
=> Illuminate\Support\Collection {#852
all: [
[
"a" => 1,
"b" => 2,
],
[
"a" => "1",
"b" => 3,
],
],
}
>>> $a->where('a',1)
=> Illuminate\Support\Collection {#877
all: [
[
"a" => 1,
"b" => 2,
],
[
"a" => "1",
"b" => 3,
],
],
}
>>> $a->whereIn('a',[1])
=> Illuminate\Support\Collection {#877
all: [
[
"a" => 1,
"b" => 2,
],
[
"a" => "1",
"b" => 3,
],
],
}
_ And This is what show on CentOS server[ Laravel 5.2 ]
>>> $a = collect([['a'=>1,'b'=>2],['a'=>'1','b'=>3]])
=> Illuminate\Support\Collection {#1414
all: [
[
"a" => 1,
"b" => 2,
],
[
"a" => "1",
"b" => 3,
],
],
}
>>> $a->where('a',1)
=> Illuminate\Support\Collection {#1394
all: [
[
"a" => 1,
"b" => 2,
],
],
}
>>> $a->whereIn('a',[1])
=> Illuminate\Support\Collection {#1388
all: [
[
"a" => 1,
"b" => 2,
],
],
}
I had read Laravel collection doc, and it said, whereIn is same as whereInLoose(however whereInLoose was removed since 5.3), but on my server, whereIn work just like whereInStrict, when I not sure about what a numeric collection value type is, it always find nothing in a collection, then result in a fatal error. Does someone know what and why it happens , Thanks !