Level 53
$test = "1,2,3,4";
$data = Test::whereNotIn('id', explode(',' $test))->get();
1 like
I have source like this :
$test = "1,2,3,4" ;
$data = Test::whereNotIn('id',[$test]) ->get(['id']);
Its giving an error like this SQLSTATE[22P02]: Invalid text representation: 7 ERROR: invalid input syntax for integer.
Im using laravel 6 and postgresql 11.
How can i solve that problem ?
$test = "1,2,3,4";
$data = Test::whereNotIn('id', explode(',' $test))->get();
Please or to participate in this conversation.