I have these two arrays as a result of requests:
$f = DocsPf::where('renda', '=', 2)->where('tipo', '=', 'R')->pluck('id');
$f = [4,5,6,7,8,9,10]
And
$d = Documento::where('user_id', '=', $id)->pluck('cad_doc_id');
[4,5,6,7,8]
Now I want to make a request to a model only with the difference between those arrays, like:
$missing = Docs::where('id', '=', 9)->first();
and
$missing = Docs::where('id', '=', 10)->first();
I´ve did
$ids = array_diff($f, $d);
return $ids;
...as the brother bellow wrote, but got hits error:
array_diff(): Expected parameter 1 to be an array, object given
Any helps, please?