original_string: protected function isModelDeletable(Model $model)
      {
          $this->lastUnmetDeleteConditionMessage = null;
  
          // access rights
          if ( ! $this->isAuthorizedToDelete()) {
              $this->lastUnmetDeleteConditionMessage = $this->getUnmetConditionMessageForAuthorizationFailure();
              return false;
          }
  
          // delete condition & model configuration
          $info = $this->getModelInformation();
  
          if ( ! $info->allowDelete()) {
              $this->lastUnmetDeleteConditionMessage = $this->getUnmetConditionMessageForDisallowedFailure();
              return false;
          }
  
          $condition = $info->deleteCondition();
  
          if ( ! $condition) {
              return true;
          }
  
          // Resolve condition and check.
          $strategies = $this->interpretDeleteCondition($condition);
  
          foreach ($strategies as $strategy => $parameters) {
  
              /** @var DeleteConditionStrategyFactoryInterface $factory */
              $factory = app(DeleteConditionStrategyFactoryInterface::class);
              $strategy = $factory->make($strategy);
  
              if ( ! $strategy->check($model, $parameters)) {
                  $this->lastUnmetDeleteConditionMessage = $strategy->message();
                  return false;
              }
          }
  
          return true;
      }
code: protected function isModelDeletable(Model $model)
      {
          $this->lastUnmetDeleteConditionMessage = null;
  
          // access rights
          if ( ! $this->isAuthorizedToDelete()) {
              $this->lastUnmetDeleteConditionMessage = $this->getUnmetConditionMessageForAuthorizationFailure();
              return false;
          }
  
          // delete condition & model configuration
          $info = $this->getModelInformation();
  
          if ( ! $info->allowDelete()) {
              $this->lastUnmetDeleteConditionMessage = $this->getUnmetConditionMessageForDisallowedFailure();
              return false;
          }
  
          $condition = $info->deleteCondition();
  
          if ( ! $condition) {
              return true;
          }
  
          // Resolve condition and check.
          $strategies = $this->interpretDeleteCondition($condition);
  
          foreach ($strategies as $strategy => $parameters) {
  
              /** @var DeleteConditionStrategyFactoryInterface $factory */
              $factory = app(DeleteConditionStrategyFactoryInterface::class);
              $strategy = $factory->make($strategy);
  
              if ( ! $strategy->check($model, $parameters)) {
                  $this->lastUnmetDeleteConditionMessage = $strategy->message();
                  return false;
              }
          }
  
          return true;
      }
code_tokens: protected function isModelDeletable ( Model $ model ) { $ this -> lastUnmetDeleteConditionMessage = null ; // access rights if ( ! $ this -> isAuthorizedToDelete ( ) ) { $ this -> lastUnmetDeleteConditionMessage = $ this -> getUnmetConditionMessageForAuthorizationFailure ( ) ; return false ; } // delete condition & model configuration $ info = $ this -> getModelInformation ( ) ; if ( ! $ info -> allowDelete ( ) ) { $ this -> lastUnmetDeleteConditionMessage = $ this -> getUnmetConditionMessageForDisallowedFailure ( ) ; return false ; } $ condition = $ info -> deleteCondition ( ) ; if ( ! $ condition ) { return true ; } // Resolve condition and check. $ strategies = $ this -> interpretDeleteCondition ( $ condition ) ; foreach ( $ strategies as $ strategy => $ parameters ) { /** @var DeleteConditionStrategyFactoryInterface $factory */ $ factory = app ( DeleteConditionStrategyFactoryInterface :: class ) ; $ strategy = $ factory -> make ( $ strategy ) ; if ( ! $ strategy -> check ( $ model , $ parameters ) ) { $ this -> lastUnmetDeleteConditionMessage = $ strategy -> message ( ) ; return false ; } } return true ; }
docstring: Returns whether a given model may be deleted.
  
  @param Model $model
  @return bool
docstring_tokens: Returns whether a given model may be deleted .