original_string: public function postDeletePhoto(Request $request)
      {
          if (session()->has('photos')) {
              $photos = session('photos');
  
              foreach ($photos as $index => $photo) {
                  if (in_array($request->input('file'), $photo)) {
                      $photo = Photo::find($photo['photo_id']);
  
                      $photo->delete();
  
                      unset($photos[$index]);
  
                      session('photos', $photos);
  
                      return response('', 200);
                  }
              }
          }
  
          return response('', 400);
      }
code: public function postDeletePhoto(Request $request)
      {
          if (session()->has('photos')) {
              $photos = session('photos');
  
              foreach ($photos as $index => $photo) {
                  if (in_array($request->input('file'), $photo)) {
                      $photo = Photo::find($photo['photo_id']);
  
                      $photo->delete();
  
                      unset($photos[$index]);
  
                      session('photos', $photos);
  
                      return response('', 200);
                  }
              }
          }
  
          return response('', 400);
      }
code_tokens: public function postDeletePhoto ( Request $ request ) { if ( session ( ) -> has ( 'photos' ) ) { $ photos = session ( 'photos' ) ; foreach ( $ photos as $ index => $ photo ) { if ( in_array ( $ request -> input ( 'file' ) , $ photo ) ) { $ photo = Photo :: find ( $ photo [ 'photo_id' ] ) ; $ photo -> delete ( ) ; unset ( $ photos [ $ index ] ) ; session ( 'photos' , $ photos ) ; return response ( '' , 200 ) ; } } } return response ( '' , 400 ) ; }
docstring: Delete a photo.
  
  @param \Illuminate\Http\Request $request
  
  @return \Illuminate\Http\Response
docstring_tokens: Delete a photo .