mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-10 08:44:49 +00:00
Update SearchController
This commit is contained in:
parent
8d0303479f
commit
4a7a56f2cb
1 changed files with 5 additions and 2 deletions
|
@ -38,7 +38,10 @@ class SearchController extends Controller
|
||||||
});
|
});
|
||||||
$tokens->push($tags);
|
$tokens->push($tags);
|
||||||
}
|
}
|
||||||
$users = Profile::select('username', 'name', 'id')->where('username', 'like', '%'.$tag.'%')->limit(20)->get();
|
$users = Profile::select('username', 'name', 'id')
|
||||||
|
->where('username', 'like', '%'.$tag.'%')
|
||||||
|
->limit(20)
|
||||||
|
->get();
|
||||||
|
|
||||||
if($users->count() > 0) {
|
if($users->count() > 0) {
|
||||||
$profiles = $users->map(function ($item, $key) {
|
$profiles = $users->map(function ($item, $key) {
|
||||||
|
@ -71,7 +74,7 @@ class SearchController extends Controller
|
||||||
'count' => 0,
|
'count' => 0,
|
||||||
'url' => $item->url(),
|
'url' => $item->url(),
|
||||||
'type' => 'status',
|
'type' => 'status',
|
||||||
'value' => 'Posted '.$item->created_at->diffForHumans(),
|
'value' => "by {$item->profile->username} <span class='float-right'>{$item->created_at->diffForHumans(null, true, true)}</span>",
|
||||||
'tokens' => [$item->caption],
|
'tokens' => [$item->caption],
|
||||||
'name' => $item->caption,
|
'name' => $item->caption,
|
||||||
'thumb' => $item->thumb(),
|
'thumb' => $item->thumb(),
|
||||||
|
|
Loading…
Reference in a new issue