mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-12-23 21:43:17 +00:00
Update ApiController
This commit is contained in:
parent
4ad7fe05fc
commit
1632d295ef
1 changed files with 4 additions and 2 deletions
|
@ -81,11 +81,13 @@ class ApiController extends BaseApiController
|
|||
|
||||
public function composeLocationSearch(Request $request)
|
||||
{
|
||||
abort_if(!Auth::check(), 403);
|
||||
$this->validate($request, [
|
||||
'q' => 'required|string'
|
||||
]);
|
||||
|
||||
$places = Place::where('name', 'like', '%' . $request->input('q') . '%')
|
||||
$q = filter_var($request->input('q'), FILTER_SANITIZE_STRING);
|
||||
$q = '%' . $q . '%';
|
||||
$places = Place::where('name', 'like', $q)
|
||||
->take(25)
|
||||
->get()
|
||||
->map(function($r) {
|
||||
|
|
Loading…
Reference in a new issue