public function getreason(Request $request){
$reasons = TradeReason::where('trade_id',$request->trade_id)->pluck("reason_id");
$reasondisplay = Reason::where "$reasons", '=', 'id')->pluck("reason");
return response() -> json($reasondisplay);
}
Its code just show only reason id but not show reason in user profile
Your function is not properly coded, So just replace your function with this code and use whereIn()
method in place of where
.
public function getreason(Request $request){
$reasons = TradeReason::where('trade_id',$request->trade_id)->pluck("reason_id");
$reasondisplay = Reason::whereIn('id',$reasons)->pluck("reason");
return response()->json($reasondisplay);
}
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments