-
Notifications
You must be signed in to change notification settings - Fork 63
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
Added search feature on Donations and Needs page #183
base: dev
Are you sure you want to change the base?
Conversation
@@ -81,7 +81,7 @@ public function searchDonations($search){ | |||
$query = $query->where(DB::Raw('CONCAT_WS(" ",name,telephone,address,city,donation,information) '),"like","%$searchPart%"); | |||
} | |||
} | |||
return $query->get(); | |||
return $query->orderBy('id', 'desc')->paginate(\Config::get('rf_settings.donations_page_pagination')); |
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.
\Config::get
can be replaced with config()
calls
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.
Apart from the requested changes, the rest looks good. Once updated I will run a manual test.
@@ -83,7 +83,7 @@ public function searchNeeds($search){ | |||
$query = $query->where(DB::Raw('CONCAT_WS(" ",name,telephone,address,city,needs)'),"like","%$searchPart%"); |
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 query might be open to SQL injection. Since the calls to searchNeeds
with the parameter is passed to a DB::raw
which doesn't use prepared statements nor sanitises the input.
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.
@nadeeravista could you please have a look on @gayanhewa's comment as well as fix conflicts?
What you've done
Added search feature on donations and needs page.
Also created a settings file which we can use to store application related settings such as pagination etc.
Why have you done it
Screenshot (if visual)
...
Any testing carried out
Locally tested with English and Sinhala