public function create() {
    $data = Ensure::Input(func_get_args());
    $data = $data->get();

    if (isset($data['domainId'])) {
      new PathResource($this, array(
         "domains" => $data['domainId'],
         "endpoints" => ""
          )
      );
    }

    return parent::create($data);
  }
public function create() {
    $data = Ensure::Input(func_get_args());
    $data = $data->get();

    if (isset($data['domainId'])) {
      new PathResource($this, array(
         "domains" => $data['domainId'],
         "endpoints" => ""
          )
      );
    }

    return parent::create($data);
  }
public function create ( ) { $ data = Ensure :: Input ( func_get_args ( ) ) ; $ data = $ data -> get ( ) ; if ( isset ( $ data [ 'domainId' ] ) ) { new PathResource ( $ this , array ( "domains" => $ data [ 'domainId' ] , "endpoints" => "" ) ) ; } return parent :: create ( $ data ) ; }
Create musn't preserve the domainId
as this will be our path. We will pass
it in the parameter, use PathResource
then remove it

@param: args Endpoint create data
Create musn t preserve the domainId as this will be our path . We will pass it in the parameter use PathResource then remove it