original_string: public function cancel($hash = null)
      {
          if (! isset($hash)) {
              return redirect()->route('admin.posts.index');
          }
  
          $userHash = $this->auth_user->hash;
          if ($this->cache->has("autoSavedPost-$userHash")) {
              $this->cache->forget("autoSavedPost-$userHash");
          }
  
          $post = $this->post->byHash($hash);
          $post->being_edited_by = null;
          $post->save();
  
          $this->tracert->log('posts', $post->id, $this->auth_user->id, 'canceled');
  
          $message = trans('blogify::notify.success', [
              'model' => 'Post', 'name' => $post->name, 'action' =>'canceled'
          ]);
          session()->flash('notify', ['success', $message]);
  
          return redirect()->route('admin.posts.index');
      }
code: public function cancel($hash = null)
      {
          if (! isset($hash)) {
              return redirect()->route('admin.posts.index');
          }
  
          $userHash = $this->auth_user->hash;
          if ($this->cache->has("autoSavedPost-$userHash")) {
              $this->cache->forget("autoSavedPost-$userHash");
          }
  
          $post = $this->post->byHash($hash);
          $post->being_edited_by = null;
          $post->save();
  
          $this->tracert->log('posts', $post->id, $this->auth_user->id, 'canceled');
  
          $message = trans('blogify::notify.success', [
              'model' => 'Post', 'name' => $post->name, 'action' =>'canceled'
          ]);
          session()->flash('notify', ['success', $message]);
  
          return redirect()->route('admin.posts.index');
      }
code_tokens: public function cancel ( $ hash = null ) { if ( ! isset ( $ hash ) ) { return redirect ( ) -> route ( 'admin.posts.index' ) ; } $ userHash = $ this -> auth_user -> hash ; if ( $ this -> cache -> has ( "autoSavedPost-$userHash" ) ) { $ this -> cache -> forget ( "autoSavedPost-$userHash" ) ; } $ post = $ this -> post -> byHash ( $ hash ) ; $ post -> being_edited_by = null ; $ post -> save ( ) ; $ this -> tracert -> log ( 'posts' , $ post -> id , $ this -> auth_user -> id , 'canceled' ) ; $ message = trans ( 'blogify::notify.success' , [ 'model' => 'Post' , 'name' => $ post -> name , 'action' => 'canceled' ] ) ; session ( ) -> flash ( 'notify' , [ 'success' , $ message ] ) ; return redirect ( ) -> route ( 'admin.posts.index' ) ; }
docstring: Cancel changes in a post
  and set being_edited_by
  back to null
  
  @param string $hash
  @return \Illuminate\Http\RedirectResponse
docstring_tokens: Cancel changes in a post and set being_edited_by back to null