mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-12-26 01:36:43 +00:00
Update AccountController
This commit is contained in:
parent
8309c85d8b
commit
a10e30aefd
1 changed files with 1 additions and 21 deletions
|
@ -33,27 +33,7 @@ class AccountController extends Controller
|
||||||
|
|
||||||
public function notifications(Request $request)
|
public function notifications(Request $request)
|
||||||
{
|
{
|
||||||
$this->validate($request, [
|
return view('account.activity');
|
||||||
'page' => 'nullable|min:1|max:3',
|
|
||||||
'a' => 'nullable|alpha_dash',
|
|
||||||
]);
|
|
||||||
$profile = Auth::user()->profile;
|
|
||||||
$action = $request->input('a');
|
|
||||||
$timeago = Carbon::now()->subMonths(6);
|
|
||||||
if ($action && in_array($action, ['comment', 'follow', 'mention'])) {
|
|
||||||
$notifications = Notification::whereProfileId($profile->id)
|
|
||||||
->whereAction($action)
|
|
||||||
->whereDate('created_at', '>', $timeago)
|
|
||||||
->orderBy('id', 'desc')
|
|
||||||
->simplePaginate(30);
|
|
||||||
} else {
|
|
||||||
$notifications = Notification::whereProfileId($profile->id)
|
|
||||||
->whereDate('created_at', '>', $timeago)
|
|
||||||
->orderBy('id', 'desc')
|
|
||||||
->simplePaginate(30);
|
|
||||||
}
|
|
||||||
|
|
||||||
return view('account.activity', compact('profile', 'notifications'));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function followingActivity(Request $request)
|
public function followingActivity(Request $request)
|
||||||
|
|
Loading…
Reference in a new issue