CMS page get url with parameters

For a model, where a page should be selected, I want to check if the URL contains :token in beforeValidate, how can I achieve that?

When I do:

dd(Page::url($this->cms_page));

Where $this->cms_page is:

Page::getNameList();

I get an url with default as my parameter, e.g. /page/default, but the name of my parameter is token, implemented like this:

url = "/page-name/:token"

/page-name/default, I suspect the page was called without any token. Ex the url called was /page-name/

The thing is that for a newsletter plugin, I want to check if in my newsletter settings the chosen unsubscribe CMS page has the parameter ‘:token’. This parameter is then later used to create a link to that page, where a component should be placed.

I would like to make it as user friendly as possible, so if somebody forgot to add ‘:token’, I show a application error.

Can I make a HTTP request to my own page and then check?

if you see default, can’t this mean the token wasn’t supplied and you display the error?