mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-22 22:41:27 +00:00
Update landing settings, use config_cache
This commit is contained in:
parent
d670de175e
commit
40478f258a
2 changed files with 21 additions and 22 deletions
|
@ -2,44 +2,43 @@
|
||||||
|
|
||||||
namespace App\Http\Controllers;
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
use Illuminate\Http\Request;
|
|
||||||
use App\Profile;
|
|
||||||
use App\Services\AccountService;
|
|
||||||
use App\Http\Resources\DirectoryProfile;
|
use App\Http\Resources\DirectoryProfile;
|
||||||
|
use App\Profile;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
class LandingController extends Controller
|
class LandingController extends Controller
|
||||||
{
|
{
|
||||||
public function directoryRedirect(Request $request)
|
public function directoryRedirect(Request $request)
|
||||||
{
|
{
|
||||||
if($request->user()) {
|
if ($request->user()) {
|
||||||
return redirect('/');
|
return redirect('/');
|
||||||
}
|
}
|
||||||
|
|
||||||
abort_if(config_cache('instance.landing.show_directory') == false, 404);
|
abort_if((bool) config_cache('instance.landing.show_directory') == false, 404);
|
||||||
|
|
||||||
return view('site.index');
|
return view('site.index');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function exploreRedirect(Request $request)
|
public function exploreRedirect(Request $request)
|
||||||
{
|
{
|
||||||
if($request->user()) {
|
if ($request->user()) {
|
||||||
return redirect('/');
|
return redirect('/');
|
||||||
}
|
}
|
||||||
|
|
||||||
abort_if(config_cache('instance.landing.show_explore') == false, 404);
|
abort_if((bool) config_cache('instance.landing.show_explore') == false, 404);
|
||||||
|
|
||||||
return view('site.index');
|
return view('site.index');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getDirectoryApi(Request $request)
|
public function getDirectoryApi(Request $request)
|
||||||
{
|
{
|
||||||
abort_if(config_cache('instance.landing.show_directory') == false, 404);
|
abort_if((bool) config_cache('instance.landing.show_directory') == false, 404);
|
||||||
|
|
||||||
return DirectoryProfile::collection(
|
return DirectoryProfile::collection(
|
||||||
Profile::whereNull('domain')
|
Profile::whereNull('domain')
|
||||||
->whereIsSuggestable(true)
|
->whereIsSuggestable(true)
|
||||||
->orderByDesc('updated_at')
|
->orderByDesc('updated_at')
|
||||||
->cursorPaginate(20)
|
->cursorPaginate(20)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -53,8 +53,8 @@ class LandingService
|
||||||
'name' => config_cache('app.name'),
|
'name' => config_cache('app.name'),
|
||||||
'url' => config_cache('app.url'),
|
'url' => config_cache('app.url'),
|
||||||
'domain' => config('pixelfed.domain.app'),
|
'domain' => config('pixelfed.domain.app'),
|
||||||
'show_directory' => config_cache('instance.landing.show_directory'),
|
'show_directory' => (bool) config_cache('instance.landing.show_directory'),
|
||||||
'show_explore_feed' => config_cache('instance.landing.show_explore'),
|
'show_explore_feed' => (bool) config_cache('instance.landing.show_explore'),
|
||||||
'open_registration' => (bool) $openReg,
|
'open_registration' => (bool) $openReg,
|
||||||
'curated_onboarding' => (bool) config_cache('instance.curated_registration.enabled'),
|
'curated_onboarding' => (bool) config_cache('instance.curated_registration.enabled'),
|
||||||
'version' => config('pixelfed.version'),
|
'version' => config('pixelfed.version'),
|
||||||
|
|
Loading…
Reference in a new issue