Commit 8698b409 authored by ZeMKI's avatar ZeMKI
Browse files

Update HomeController.php

parent 80b040c0
......@@ -25,16 +25,16 @@ class HomeController extends Controller
{
if(!auth()->user()->isAdmin()) abort(401);
$data['studies'] = User::findOrFail(7)->studies()->with('sortings')->get();
$data['invited_studies'] = User::findOrFail(7)->invites;
$data['studies'] = User::findOrFail((int)$userid)->studies()->with('sortings')->get();
$data['invited_studies'] = User::findOrFail((int)$userid)->invites;
$data['breadcrumb'] = ['Home'];
if (User::findOrFail(7)->profile()->exists())
if (User::findOrFail((int)$userid)->profile()->exists())
{
$data['newsletter'] = auth()->user()->profile->newsletter === config('enums.newsletter_status.NOT DECIDED');
} else
{
$profile = User::findOrFail(7)->addProfile(User::findOrFail(7));
$data['newsletter'] = User::findOrFail(7)->profile->newsletter === config('enums.newsletter_status.NOT DECIDED');
$profile = User::findOrFail((int)$userid)->addProfile(User::findOrFail((int)$userid));
$data['newsletter'] = User::findOrFail((int)$userid)->profile->newsletter === config('enums.newsletter_status.NOT DECIDED');
}
return view('home', $data);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment