I need to select distinct value and push them into an array. After that, i need to verify if a variable is situated into the array.
Controller:
$people = DB::table('checklists')->select('incaricato')->distinct()->get()->toArray();
if (in_array(\Auth::user()->id, $people)) {
$variable = "yes";
}
Error:
Object of class stdClass could not be converted to int
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire