public function tasks()
 {
     $items = item::all();
     $train_responses = train_response::all();
     $categories = permission::select('projects.title as projecttitle', 'categories.*')->where('permissions.userid', '=', Auth::user()->id)->join('projects', 'permissions.projectid', '=', 'projects.id')->orderBy('projects.created_at', 'desc')->join('categories', 'categories.projectid', '=', 'projects.id')->orderBy('categories.codegroup', 'desc')->orderBy('projecttitle', 'desc')->get();
     $data = array('categories' => $categories, 'items' => $items, 'train_responses' => $train_responses);
     return view('pages.tasks')->with($data);
 }
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $permissions = permission::all();
     return view('user.permissions', ['permissions' => $permissions]);
 }