I want to show reason in user profile but show reason id in user profile

user9752285
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

Chirag Patel

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.

edited at
0

Comments

0 comments
Login to comment

Related

I want show user's products in related user's profile with template tags in Django

thymeleaf show specific user profile

I want to show the Default pic to the user profile whenever a new user is registered using Signals without doing it manually from Django admin

I addded a custom field in mdl_user in SQL, I want to show this custom field in the frontend, in profile edit page

Horizontally of circular images to show user profile picture

SharePoint REST show current user profile picture

making user post show on profile page

Show user profile folder link on navigation pane

How to properly show profile picutre for user

How To Show User Profile To Everyone By Link! in Django

Is it safe to show user IDs in the profile URL?

Django - Allow User to Edit Profile and then Show Updated Profile fields

i want to create a list of user profile in flutter?

Using GetStream, can I show a user's actions on his follower's timeline but not on his profile feed?

Android: trying to show info based on what user profile has

Rails : Return an object to show user's profile completeness

show a Facebook user profile image from url to image view

I want to save Boolean state to user profile in Firebase database

Get user profile picture by Id

django - i want to redirect to the profile page after a user edits thier profile

I want to update user profile picture in all the posts as well he posted when user updated/Change his profile picture

UIScrollView: Show user profile Images in a scroll view when user name is called from firebase

Windows 7 login screen show only last user and "Other User" icons after profile problem

I want to display user image on my index.html {{ user.UserProfileInfo.profile_pic.url }}

What is the normal reason for changing user ID?

I want to show Modal popup and pass data to modal according to user-id in Laravel Blade

iOS Swift how detect login error reason to show proper error alert to the user

I need to show profile image in round shape

my user_id profile database is null, how i insert the value in user_id?