Answer the question
In order to leave comments, you need to log in
Search in Laravel collection?
There is a feature table
$compares = Compare::where('gender','=',$user->attributes->gender)->get();
$hair_color = Compare::where('value','=', $user->attributes->hair_color)->where('type','=', 3)->first();
if ($hair_color){
$appearances.=$hair_color->content.',';
}
$eye_color = Compare::where('value','=', $user->attributes->eye_color)->where('type','=', 4)->first();
if ($eye_color){
$appearances.=$eye_color->content.',';
}
$appearance = Compare::where('value','=', $user->attributes->appearance)->where('type','=', 5)->first();
if ($appearance){
$appearances.=$appearance->content.',';
}
$body_type = Compare::where('value','=', $user->attributes->body_type)->where('type','=', 6)->first();
if ($body_type){
$appearances.=$body_type->content.',';
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question