public function supprimertache(Requests\reqsupprimertache $req)
 {
     $param = $req->all();
     //verif voir Requests\reqsupprimertache
     //Stocker dans la bdd
     $tache = Tache::find($param['id']);
     $tache->delete();
     //Redirection vers accueil
     return redirect()->route('listtaches')->with('status', 'OK, c\'est modifier');
 }
 /**
  * Determine if the user is authorized to make this request.
  *
  * @return bool
  */
 public function authorize()
 {
     //verifier si la tache exist
     if ($tacheencours = Tache::find($this->idtacheprincipal)) {
         //verifier si l'utilisateur est bien celui qui est loggué
         if (Auth::user()->id == $tacheencours->idutilisateur) {
             return true;
         }
     }
     return false;
 }
Example #3
0
 public function updateTache(TacheUpdateRequest $req)
 {
     $tache = Tache::find($req->id);
     if (isset($req->remove)) {
         $tache->delete();
         return redirect()->back()->with('status', 'Tâche supprimée !');
     }
     $tache->update($req->all());
     $tache->save();
     return redirect()->back()->with('status', 'Tâche mise à jour !');
 }
Example #4
0
 public function authorize()
 {
     if ($current_tache = Tache::find($this->id)) {
         if ($current_liste = Liste::find($current_tache->id_liste)) {
             if (Auth::user()->id == $current_liste->id_user) {
                 return true;
             }
         }
     }
     return false;
 }
 /**
  * Determine if the user is authorized to make this request.
  *
  * @return bool
  */
 public function authorize()
 {
     //verifier que la tache exist
     if ($tacheencours = Tache::find($this->id)) {
         //verifier que la soustache appartient bien a l'utilisateur logué
         if (Auth::user()->id == $tacheencours->idutilisateur) {
             return true;
         }
     }
     return false;
 }
 public function ModifierTache(Request $request, $list)
 {
     if (Auth::user()) {
         $id = Auth::user()->id;
     }
     $tache = new Tache();
     $tache = Tache::find($list);
     $tache->name = $request->input('nom');
     $tache->Description = $request->input('Description');
     $tache->update();
     return redirect('/');
 }
 public function delete($id)
 {
     $tache = new Tache();
     $tache = Tache::find($id);
     $tache->delete();
     return redirect('/membres/espace_membre');
 }