|
@@ -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()) {
|
|
|
|
- return redirect('/');
|
|
|
|
- }
|
|
|
|
|
|
+ if ($request->user()) {
|
|
|
|
+ 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()) {
|
|
|
|
- return redirect('/');
|
|
|
|
- }
|
|
|
|
|
|
+ if ($request->user()) {
|
|
|
|
+ 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);
|
|
|
|
-
|
|
|
|
- return DirectoryProfile::collection(
|
|
|
|
- Profile::whereNull('domain')
|
|
|
|
- ->whereIsSuggestable(true)
|
|
|
|
- ->orderByDesc('updated_at')
|
|
|
|
- ->cursorPaginate(20)
|
|
|
|
- );
|
|
|
|
|
|
+ abort_if((bool) config_cache('instance.landing.show_directory') == false, 404);
|
|
|
|
+
|
|
|
|
+ return DirectoryProfile::collection(
|
|
|
|
+ Profile::whereNull('domain')
|
|
|
|
+ ->whereIsSuggestable(true)
|
|
|
|
+ ->orderByDesc('updated_at')
|
|
|
|
+ ->cursorPaginate(20)
|
|
|
|
+ );
|
|
}
|
|
}
|
|
}
|
|
}
|