private function replacePrimaryKey($modelData)
    {
        $primaryKey = 'id';

        foreach ($modelData->fields as $field)
        {
            if ($field->index == 'primary')
            {
                $primaryKey = $field->name;
                break;
            }
        }

        $this->stub = str_replace('{{primaryKey}}', $primaryKey, $this->stub);

        return $this;
    }
private function replacePrimaryKey($modelData)
    {
        $primaryKey = 'id';

        foreach ($modelData->fields as $field)
        {
            if ($field->index == 'primary')
            {
                $primaryKey = $field->name;
                break;
            }
        }

        $this->stub = str_replace('{{primaryKey}}', $primaryKey, $this->stub);

        return $this;
    }
private function replacePrimaryKey ( $ modelData ) { $ primaryKey = 'id' ; foreach ( $ modelData -> fields as $ field ) { if ( $ field -> index == 'primary' ) { $ primaryKey = $ field -> name ; break ; } } $ this -> stub = str_replace ( '{{primaryKey}}' , $ primaryKey , $ this -> stub ) ; return $ this ; }
Replace the primary key.

@param $modelData

@return $this
Replace the primary key .