Files
2026-04-25 22:57:18 +10:00

32 lines
654 B
PHP

<?php
namespace App\Http\Controllers;
use App\Models\UserAction;
use Illuminate\Http\Request;
use Inertia\Inertia;
class FeedController extends Controller
{
public function view()
{
$user = auth()->user();
$followeeIds = $user->following()->pluck('followee_id');
$feed = UserAction::whereIn('user_id', $followeeIds)
->whereNotIn('type', ['flight_deleted'])
->with([
'user',
])
->latest()
->limit(50)
->get();
return Inertia::render('Feed', [
'user' => $user,
'feed' => $feed,
]);
}
}