protected function createAssignment()
    {
        $url = config('forge-publish.url') . config('forge-publish.store_assignment_uri');
        try {
            $response = $this->http->post($url, [
                'form_params' => [
                    'name' => $this->assignmentName,
                    'repository_uri' => $this->repository_uri,
                    'repository_type' => $this->repository_type,
                    'forge_site' => $this->forge_site,
                    'forge_server' => $this->forge_server
                ],
                'headers' => [
                    'X-Requested-With' => 'XMLHttpRequest',
                    'Authorization' => 'Bearer ' . fp_env('ACACHA_FORGE_ACCESS_TOKEN')
                ]
            ]);
        } catch (\Exception $e) {
            $this->error('And error occurs connecting to the api url: ' . $url);
            $this->error('Status code: ' . $e->getResponse()->getStatusCode() . ' | Reason : ' . $e->getResponse()->getReasonPhrase());
            return;
        }
        $assignment = json_decode((string) $response->getBody());
        $this->addValueToEnv('ACACHA_FORGE_ASSIGNMENT', $assignment->id);
        return $assignment;
    }
protected function createAssignment()
    {
        $url = config('forge-publish.url') . config('forge-publish.store_assignment_uri');
        try {
            $response = $this->http->post($url, [
                'form_params' => [
                    'name' => $this->assignmentName,
                    'repository_uri' => $this->repository_uri,
                    'repository_type' => $this->repository_type,
                    'forge_site' => $this->forge_site,
                    'forge_server' => $this->forge_server
                ],
                'headers' => [
                    'X-Requested-With' => 'XMLHttpRequest',
                    'Authorization' => 'Bearer ' . fp_env('ACACHA_FORGE_ACCESS_TOKEN')
                ]
            ]);
        } catch (\Exception $e) {
            $this->error('And error occurs connecting to the api url: ' . $url);
            $this->error('Status code: ' . $e->getResponse()->getStatusCode() . ' | Reason : ' . $e->getResponse()->getReasonPhrase());
            return;
        }
        $assignment = json_decode((string) $response->getBody());
        $this->addValueToEnv('ACACHA_FORGE_ASSIGNMENT', $assignment->id);
        return $assignment;
    }
protected function createAssignment ( ) { $ url = config ( 'forge-publish.url' ) . config ( 'forge-publish.store_assignment_uri' ) ; try { $ response = $ this -> http -> post ( $ url , [ 'form_params' => [ 'name' => $ this -> assignmentName , 'repository_uri' => $ this -> repository_uri , 'repository_type' => $ this -> repository_type , 'forge_site' => $ this -> forge_site , 'forge_server' => $ this -> forge_server ] , 'headers' => [ 'X-Requested-With' => 'XMLHttpRequest' , 'Authorization' => 'Bearer ' . fp_env ( 'ACACHA_FORGE_ACCESS_TOKEN' ) ] ] ) ; } catch ( \ Exception $ e ) { $ this -> error ( 'And error occurs connecting to the api url: ' . $ url ) ; $ this -> error ( 'Status code: ' . $ e -> getResponse ( ) -> getStatusCode ( ) . ' | Reason : ' . $ e -> getResponse ( ) -> getReasonPhrase ( ) ) ; return ; } $ assignment = json_decode ( ( string ) $ response -> getBody ( ) ) ; $ this -> addValueToEnv ( 'ACACHA_FORGE_ASSIGNMENT' , $ assignment -> id ) ; return $ assignment ; }
Create assignment.

@return array|mixed
Create assignment .