Update SiteController

This commit is contained in:
Daniel Supernault 2019-11-22 23:33:47 -07:00
parent 7311e81382
commit d2c53dc56a
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7

View file

@ -10,10 +10,10 @@ use App\Util\Localization\Localization;
class SiteController extends Controller
{
public function home()
public function home(Request $request)
{
if (Auth::check()) {
return $this->homeTimeline();
return $this->homeTimeline($request);
} else {
return $this->homeGuest();
}
@ -24,9 +24,13 @@ class SiteController extends Controller
return view('site.index');
}
public function homeTimeline()
public function homeTimeline(Request $request)
{
return view('timeline.home');
$this->validate($request, [
'layout' => 'nullable|string|in:grid,feed'
]);
$layout = $request->input('layout', 'feed');
return view('timeline.home', compact('layout'));
}
public function changeLocale(Request $request, $locale)