original_string: public function findOrFail($id, $columns = ['*'])
      {
          $result = $this->find($id, $columns);
  
          if (is_array($id)) {
              if (count($result) === count(array_unique($id))) {
                  return $result;
              }
          } elseif (! is_null($result)) {
              return $result;
          }
  
          throw (new ModelNotFoundException)->setModel(get_class($this->related), $id);
      }
code: public function findOrFail($id, $columns = ['*'])
      {
          $result = $this->find($id, $columns);
  
          if (is_array($id)) {
              if (count($result) === count(array_unique($id))) {
                  return $result;
              }
          } elseif (! is_null($result)) {
              return $result;
          }
  
          throw (new ModelNotFoundException)->setModel(get_class($this->related), $id);
      }
code_tokens: public function findOrFail ( $ id , $ columns = [ '*' ] ) { $ result = $ this -> find ( $ id , $ columns ) ; if ( is_array ( $ id ) ) { if ( count ( $ result ) === count ( array_unique ( $ id ) ) ) { return $ result ; } } elseif ( ! is_null ( $ result ) ) { return $ result ; } throw ( new ModelNotFoundException ) -> setModel ( get_class ( $ this -> related ) , $ id ) ; }
docstring: Find a related model by its primary key or throw an exception.
  
  @param  mixed  $id
  @param  array  $columns
  @return \Illuminate\Database\Eloquent\Model|\Illuminate\Database\Eloquent\Collection
  
  @throws \Illuminate\Database\Eloquent\ModelNotFoundException
docstring_tokens: Find a related model by its primary key or throw an exception .