src/Api/Route.php
public function create(string $expression, array $actions, string $description, int $priority = 0)
    {
        Assert::isArray($actions);

        $params = [
            'priority' => (string) $priority,
            'expression' => $expression,
            'action' => $actions,
            'description' => $description,
        ];

        $response = $this->httpPost('/v3/routes', $params);

        return $this->hydrateResponse($response, CreateResponse::class);
    }
public function create(string $expression, array $actions, string $description, int $priority = 0)
    {
        Assert::isArray($actions);

        $params = [
            'priority' => (string) $priority,
            'expression' => $expression,
            'action' => $actions,
            'description' => $description,
        ];

        $response = $this->httpPost('/v3/routes', $params);

        return $this->hydrateResponse($response, CreateResponse::class);
    }
public function create ( string $ expression , array $ actions , string $ description , int $ priority = 0 ) { Assert :: isArray ( $ actions ) ; $ params = [ 'priority' => ( string ) $ priority , 'expression' => $ expression , 'action' => $ actions , 'description' => $ description , ] ; $ response = $ this -> httpPost ( '/v3/routes' , $ params ) ; return $ this -> hydrateResponse ( $ response , CreateResponse :: class ) ; }
Creates a new Route.

@param string $expression  A filter expression like "match_recipient('.*@gmail.com')"
@param array  $actions     Route action. This action is executed when the expression evaluates to True. Example: "forward('alice@example.com')"
@param string $description An arbitrary string
@param int    $priority    Integer: smaller number indicates higher priority. Higher priority routes are handled first. Defaults to 0.

@return CreateResponse
Creates a new Route .