Added splash page
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\UserFlight;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Cache;
|
||||
use Inertia\Inertia;
|
||||
use Inertia\Response;
|
||||
|
||||
class HomePageController extends Controller
|
||||
{
|
||||
function mostRecentFlights()
|
||||
{
|
||||
return Cache::remember('splash_flights', now()->addHours(12), function () {
|
||||
return UserFlight::query()
|
||||
->with(['departureAirport', 'arrivalAirport'])
|
||||
->whereHas('user', function ($query) {
|
||||
$query->whereRaw("settings->>'profile_privacy' is distinct from 'private'");
|
||||
})
|
||||
->orderByDesc('departure_date')
|
||||
->limit(50)
|
||||
->get()
|
||||
->values()
|
||||
->toJson();
|
||||
});
|
||||
}
|
||||
|
||||
function splash(){
|
||||
return Inertia::render('Splash');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user