Skip to content
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

Merged
merged 5 commits into from
Sep 13, 2018
Merged

Revision of #5471 #6148

merged 5 commits into from
Sep 13, 2018

Conversation

inietov
Copy link
Collaborator

@inietov inietov commented Sep 1, 2018

Fixed #5471. A better solution than the last using collections methods. Now Querying the established relation between Accessory and User

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.
@inietov inietov requested a review from snipe as a code owner September 1, 2018 10:30
@inietov inietov changed the title Develop Revision of my last PR Sep 1, 2018
@inietov inietov changed the title Revision of my last PR Revision of #5471 Sep 1, 2018
$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()
Copy link
Contributor

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.

Copy link
Collaborator Author

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.

@snipe snipe merged commit b692f67 into snipe:develop Sep 13, 2018
@snipe
Copy link
Owner

snipe commented Sep 13, 2018

community-thankyou

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants