Ejemplo n.º 1
0
 /**
  * Display the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function show($id)
 {
     $taches = Tache::all();
     $test = true;
     foreach ($taches as $tache) {
         if ($tache->sprint_id == $id) {
             if ($tache->developer_id == Auth::id() && $tache->state == 1) {
                 $tache->update(['state' => 2]);
                 $tachesn = Tache::where('us_story_id', $tache->us_story_id)->get();
                 foreach ($tachesn as $tachen) {
                     if ($tachen->state != 2) {
                         $test = false;
                         break;
                     }
                 }
                 $userstory = Userstory::findOrFail($tache->us_story_id);
                 /*  if($test == true){
                         $userstory->update(['status'=> 1]);
                     }
                     else{
                         $userstory->update(['status'=> 0]);
                     }*/
             }
         }
     }
     return redirect(route('kanban.taches.show', $id));
     // return view('kanban.taches.show',compact('id'));
     //     return redirect(route('kanban.taches.index',$id));
 }