-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Revision of #5471 #6148
Revision of #5471 #6148
Conversation
From the collection of users displayed just filtered the data with the method where() and concat() for the user can search for first name or last name. The solution is case sensitive.
…o querying for the users. Also Case-insensitive.
$accessory_users = $accessory_users->where('first_name', $request->input('search'))->concat($accessory_users->where('last_name', $request->input('search'))); | ||
|
||
if ($request->filled('search')) { | ||
$accessory_users = Accessory::find(1)->users() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should use $accessory->users() correct? Currently you're searching against an accessory with a specific id.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ugh, yeah sorry... I actually tried to use 'Accessory::find($id)->users()' but I let the magic number behind. Your solution looks better, thank you.
…ter of AccessoriesController.
Fixed #5471. A better solution than the last using collections methods. Now Querying the established relation between Accessory and User