Skip to content
Advertisement

im having problem with join on multi table in laravel

working on group chat web app with laravel

i want to perform search for user on particular group with their name

so basically there are three table

users -> id , timeline_id , email , pw

timelines -> id , fname , lname , p_no

page_user(defines user on particular group/page) -> id , page_id , user_id

page -> id , timeline_id, pg_name

when i perform search on one selected group , query giving search from whole user not from selected group

JavaScript

where i need to do change ; considering that $page_id = 1; $q is search value;

Advertisement

Answer

JavaScript

it worked but dont know why ->where('page_user.page_id','=',$pgid) required more time , is that I did something wrong? if i put this on first place only then wont work for timeline.lastname and users.primarycontactno , if anyone has optimized solution do share;)

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement