Exemplo n.º 1
0
 public function accept($id)
 {
     $req = friendship::find($id);
     if ($req->status != friendship::STATUS_ACCEPTED) {
         $req->update(['status' => friendship::STATUS_ACCEPTED]);
         $rel = new friendship();
         $rel->follower_id = $req->followee_id;
         $rel->followee_id = $req->follower_id;
         $rel->status = friendship::STATUS_ACCEPTED;
         $rel->save();
     }
     return Response::json(array('success' => true));
 }