original_string: protected function whenPivotLoadedAs($accessor, $table, $value, $default = null)
      {
          if (func_num_args() === 3) {
              $default = new MissingValue;
          }
  
          return $this->when(
              $this->resource->$accessor &&
              ($this->resource->$accessor instanceof $table ||
              $this->resource->$accessor->getTable() === $table),
              ...[$value, $default]
          );
      }
code: protected function whenPivotLoadedAs($accessor, $table, $value, $default = null)
      {
          if (func_num_args() === 3) {
              $default = new MissingValue;
          }
  
          return $this->when(
              $this->resource->$accessor &&
              ($this->resource->$accessor instanceof $table ||
              $this->resource->$accessor->getTable() === $table),
              ...[$value, $default]
          );
      }
code_tokens: protected function whenPivotLoadedAs ( $ accessor , $ table , $ value , $ default = null ) { if ( func_num_args ( ) === 3 ) { $ default = new MissingValue ; } return $ this -> when ( $ this -> resource -> $ accessor && ( $ this -> resource -> $ accessor instanceof $ table || $ this -> resource -> $ accessor -> getTable ( ) === $ table ) , ... [ $ value , $ default ] ) ; }
docstring: Execute a callback if the given pivot table with a custom accessor has been loaded.
  
  @param  string  $accessor
  @param  string  $table
  @param  mixed  $value
  @param  mixed  $default
  @return \Illuminate\Http\Resources\MissingValue|mixed
docstring_tokens: Execute a callback if the given pivot table with a custom accessor has been loaded .