fixed bug password wouldn't get hashed when changed through admin/mod view, added so group 1 test can be seen by every mod

This commit is contained in:
mwalbeck 2016-10-27 12:59:17 +02:00
parent 6511f3a248
commit 12f6d58099
9 changed files with 87 additions and 27 deletions
app/Http/Controllers

View file

@ -5,6 +5,8 @@ namespace App\Http\Controllers;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use App\Http\Requests;
use App\Group;
use App\Test;
class ModeratorController extends Controller
{
@ -29,4 +31,22 @@ class ModeratorController extends Controller
$tests = Auth::user()->group->getGroupTests();
return view('tests.showall', compact('tests'));
}
public function showGroups()
{
$groups = Group::find([1, Auth::user()->group_id]);
return view('admin.groups', compact("groups"));
}
public function showAllTests()
{
$tests = Test::where("group_id", 1)->orWhere("group_id", Auth::user()->group_id)->get();
return view('tests.showall', compact("tests"));
}
public function showGroupTests(Group $group)
{
$tests = $group->tests;
return view('tests.showall', compact('tests'));
}
}