protected function whenPivotLoaded($table, $value, $default = null)
    {
        if (func_num_args() === 2)
            $default = new MissingValue;

        return $this->when(
            $this->pivot && ($this->pivot instanceof $table || $this->pivot->getTable() === $table),
            ...[$value, $default]
        );
    }
protected function whenPivotLoaded($table, $value, $default = null)
    {
        if (func_num_args() === 2)
            $default = new MissingValue;

        return $this->when(
            $this->pivot && ($this->pivot instanceof $table || $this->pivot->getTable() === $table),
            ...[$value, $default]
        );
    }
protected function whenPivotLoaded ( $ table , $ value , $ default = null ) { if ( func_num_args ( ) === 2 ) $ default = new MissingValue ; return $ this -> when ( $ this -> pivot && ( $ this -> pivot instanceof $ table || $ this -> pivot -> getTable ( ) === $ table ) , ... [ $ value , $ default ] ) ; }
Execute a callback if the given pivot table has been loaded.

@param  string  $table
@param  mixed   $value
@param  mixed   $default

@return \Illuminate\Http\Resources\MissingValue|mixed
Execute a callback if the given pivot table has been loaded .