Skip to content
Advertisement

Laravel 8 – Get search result in friend lists

I am Working on laravel 8 version. I have two Models

JavaScript

were table structure is as following.

User

JavaScript

FriendList

JavaScript

i want to search result from User but condition is like it should be in friendlist and user should be individual (is_individual = 1)

I have tried following but i wan improve this.

Controller

JavaScript

FriendList

JavaScript

Help me to improve this. Thanks

Advertisement

Answer

I Have found an alternate way using query as following

JavaScript

Please do let me know if we still can improve this. Thanks

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