1
0
Fork 0
forked from mirror/pixelfed
pixelfed/app/Http/Controllers/LandingController.php

46 lines
998 B
PHP
Raw Normal View History

2023-04-08 04:35:51 +00:00
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Profile;
use App\Services\AccountService;
use App\Http\Resources\DirectoryProfile;
class LandingController extends Controller
{
public function directoryRedirect(Request $request)
{
if($request->user()) {
return redirect('/');
}
2023-04-10 02:34:50 +00:00
abort_if(config('instance.landing.show_directory') == false, 404);
2023-04-08 04:35:51 +00:00
return view('site.index');
}
public function exploreRedirect(Request $request)
{
if($request->user()) {
return redirect('/');
}
abort_if(config('instance.landing.show_explore') == false, 404);
2023-04-08 04:35:51 +00:00
return view('site.index');
}
public function getDirectoryApi(Request $request)
{
abort_if(config('instance.landing.show_directory') == false, 404);
2023-04-08 04:35:51 +00:00
return DirectoryProfile::collection(
Profile::whereNull('domain')
->whereIsSuggestable(true)
->orderByDesc('updated_at')
->cursorPaginate(20)
);
}
}