public function visitor($id, $key) { if ($key == Visitor::where("project_id", $id)->get()->first()->Key) { $userstories = DB::table('userstory')->where('project_id', $id)->get(); return view("Backlog")->with('userstories', $userstories)->with('idProject', $id); } }
public function forbid($project_id) { $key = Visitor::where("project_id", $project_id)->get()->first(); if ($key != null) { DB::table('visitor')->where('project_id', $project_id)->delete(); } $key = Visitor::where("project_id", $project_id)->get()->first(); return redirect()->action("VisitorController@show", [$project_id]); }
public function __construct(\Illuminate\Http\Request $request) { $key = $request->route()->key; $idProject = $request->route()->idProject; if ($key != null) { if (Visitor::where("Key", $key)->where("project_id", $idProject)->get()->first() == null) { $this->middleware('auth'); } } else { $this->middleware('auth'); } }
public function show($project_id, $sprint_id, $key = null) { if ($key != null) { if (Visitor::where("key", $key)->where("project_id", $project_id)->get() != null) { $todos = DB::table('userstory')->where("tache.Status", 0)->join('tache', 'tache.us_story_id', '=', 'userstory.id')->where('userstory.sprint_id', $sprint_id)->where('userstory.project_id', $project_id)->get(); $goings = DB::table('userstory')->where("tache.Status", 1)->join('tache', 'tache.us_story_id', '=', 'userstory.id')->where('userstory.sprint_id', $sprint_id)->where('userstory.project_id', $project_id)->get(); $dones = DB::table('userstory')->where("tache.Status", 2)->join('tache', 'tache.us_story_id', '=', 'userstory.id')->where('userstory.sprint_id', $sprint_id)->where('userstory.project_id', $project_id)->get(); return view("kanban.show")->with('todos', $todos)->with('ongoings', $goings)->with('dones', $dones); } } return Redirect()->action('Auth\\AuthController@getLogin'); }
/** * [updateVisitor description] * @param [type] $cvuid [description] * @return [type] [description] */ public function updateVisitor($cvuid) { // TODO // // Fixa bättre kakhantering. Just nu lagras id i klartext i javascriptvariabel. // Hämta istället den krypterade kakan som innehåller user id. // // $v = Visitor::where('session', $cvuid)->first(); $v->touch(); $dn = date('Y-m-d H:i:s', time() - 10); $v2 = Visitor::where('updated_at', '<', $dn)->delete(); $count = Visitor::all()->count(); return $count; }